[pure-lang-svn] SF.net SVN: pure-lang:[596] pure/trunk/test
Status: Beta
Brought to you by:
agraef
|
From: <ag...@us...> - 2008-08-24 00:11:24
|
Revision: 596
http://pure-lang.svn.sourceforge.net/pure-lang/?rev=596&view=rev
Author: agraef
Date: 2008-08-24 00:11:34 +0000 (Sun, 24 Aug 2008)
Log Message:
-----------
Cosmetic changes.
Modified Paths:
--------------
pure/trunk/test/test020.log
pure/trunk/test/test020.pure
pure/trunk/test/test021.log
pure/trunk/test/test021.pure
Modified: pure/trunk/test/test020.log
===================================================================
--- pure/trunk/test/test020.log 2008-08-23 23:56:43 UTC (rev 595)
+++ pure/trunk/test/test020.log 2008-08-24 00:11:34 UTC (rev 596)
@@ -49,6 +49,27 @@
show (x/*0:101*/+:y/*0:11*/) = show x/*0:101*/+"+:"+show y/*0:11*/;
show (x/*0:101*/<:y/*0:11*/) = show x/*0:101*/+"<:"+show y/*0:11*/;
show x/*0:1*/ = str x/*0:1*/;
+tests = puts "*** UNARY ***"$$void (catmap (\f/*0:*/ -> catmap (\x/*0:*/ -> [test (f/*1:*/,x/*0:*/)] {
+ rule #0: x = [test (f,x)]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) x {
+ rule #0: f = catmap (\x -> [test (f,x)]) x
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) f)$$puts "*** BINARY ***"$$void (catmap (\f/*0:*/ -> catmap (\x/*0:*/ -> [test (f/*1:*/,x/*0:*/)] {
+ rule #0: x = [test (f,x)]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) x2 {
+ rule #0: f = catmap (\x -> [test (f,x)]) x2
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) f2);
{
rule #0: check _ z = z if numberp z
rule #1: check (f,x,y) (g@_ u v) = __failed__ if f===g&&x===u&&y===v
@@ -259,6 +280,10 @@
<var> state 15
state 15: #2 #3
}
+{
+ rule #0: tests = puts "*** UNARY ***"$$void (catmap (\f -> catmap (\x -> [test (f,x)]) x) f)$$puts "*** BINARY ***"$$void (catmap (\f -> catmap (\x -> [test (f,x)]) x2) f2)
+ state 0: #0
+}
*** UNARY ***
sqrt,1,1.00
sqrt,-1,nan
@@ -5157,25 +5182,5 @@
pow,x,-inf,__failed__
pow,x,nan,__failed__
pow,x,x,__failed__
-puts "*** UNARY ***"$$void (catmap (\f/*0:*/ -> catmap (\x/*0:*/ -> [test (f/*1:*/,x/*0:*/)] {
- rule #0: x = [test (f,x)]
- state 0: #0
- <var> state 1
- state 1: #0
-}) x {
- rule #0: f = catmap (\x -> [test (f,x)]) x
- state 0: #0
- <var> state 1
- state 1: #0
-}) f)$$puts "*** BINARY ***"$$void (catmap (\f/*0:*/ -> catmap (\x/*0:*/ -> [test (f/*1:*/,x/*0:*/)] {
- rule #0: x = [test (f,x)]
- state 0: #0
- <var> state 1
- state 1: #0
-}) x2 {
- rule #0: f = catmap (\x -> [test (f,x)]) x2
- state 0: #0
- <var> state 1
- state 1: #0
-}) f2);
+tests;
()
Modified: pure/trunk/test/test020.pure
===================================================================
--- pure/trunk/test/test020.pure 2008-08-23 23:56:43 UTC (rev 595)
+++ pure/trunk/test/test020.pure 2008-08-24 00:11:34 UTC (rev 596)
@@ -47,5 +47,8 @@
show (x<:y) = show x+"<:"+show y;
show x = str x otherwise;
+tests =
puts "*** UNARY ***" $$ void [test (f,x); f=f; x=x] $$
puts "*** BINARY ***" $$ void [test (f,x); f=f2; x=x2];
+
+tests;
Modified: pure/trunk/test/test021.log
===================================================================
--- pure/trunk/test/test021.log 2008-08-23 23:56:43 UTC (rev 595)
+++ pure/trunk/test/test021.log 2008-08-24 00:11:34 UTC (rev 596)
@@ -11,6 +11,47 @@
show (x/*0:101*/+:y/*0:11*/) = show x/*0:101*/+"+:"+show y/*0:11*/;
show (x/*0:101*/<:y/*0:11*/) = show x/*0:101*/+"<:"+show y/*0:11*/;
show x/*0:1*/ = str x/*0:1*/;
+tests = puts "*** EXACT/INEXACT ***"$$do test (catmap (\op/*0:*/ -> catmap (\a/*0:*/ -> [(op/*1:*/,2,a/*0:*/)] {
+ rule #0: a = [(op,2,a)]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) [2+:3,2<:3,2%3] {
+ rule #0: op = catmap (\a -> [(op,2,a)]) [2+:3,2<:3,2%3]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) [(+),(-),(*),(%),(/),(^)])$$do test (catmap (\op/*0:*/ -> catmap (\a/*0:*/ -> [(op/*1:*/,a/*0:*/,2)] {
+ rule #0: a = [(op,a,2)]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) [2+:3,2<:3,2%3] {
+ rule #0: op = catmap (\a -> [(op,a,2)]) [2+:3,2<:3,2%3]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) [(+),(-),(*),(%),(/),(^)])$$puts "*** SYMBOLIC ***"$$do test (catmap (\op/*0:*/ -> catmap (\a/*0:*/ -> [(op/*1:*/,x,a/*0:*/)] {
+ rule #0: a = [(op,x,a)]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) [2+:3,2<:3,2%3] {
+ rule #0: op = catmap (\a -> [(op,x,a)]) [2+:3,2<:3,2%3]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) [(+),(-),(*),(%),(/),(^)])$$do test (catmap (\op/*0:*/ -> catmap (\a/*0:*/ -> [(op/*1:*/,a/*0:*/,x)] {
+ rule #0: a = [(op,a,x)]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) [2+:3,2<:3,2%3] {
+ rule #0: op = catmap (\a -> [(op,a,x)]) [2+:3,2<:3,2%3]
+ state 0: #0
+ <var> state 1
+ state 1: #0
+}) [(+),(-),(*),(%),(/),(^)]);
{
rule #0: check _ z = z if numberp z
rule #1: check (f,x,y) (g@_ u v) = __failed__ if f===g&&x===u&&y===v
@@ -221,6 +262,10 @@
<var> state 15
state 15: #2 #3
}
+{
+ rule #0: tests = puts "*** EXACT/INEXACT ***"$$do test (catmap (\op -> catmap (\a -> [(op,2,a)]) [2+:3,2<:3,2%3]) [(+),(-),(*),(%),(/),(^)])$$do test (catmap (\op -> catmap (\a -> [(op,a,2)]) [2+:3,2<:3,2%3]) [(+),(-),(*),(%),(/),(^)])$$puts "*** SYMBOLIC ***"$$do test (catmap (\op -> catmap (\a -> [(op,x,a)]) [2+:3,2<:3,2%3]) [(+),(-),(*),(%),(/),(^)])$$do test (catmap (\op -> catmap (\a -> [(op,a,x)]) [2+:3,2<:3,2%3]) [(+),(-),(*),(%),(/),(^)])
+ state 0: #0
+}
*** EXACT/INEXACT ***
(+),2,2+:3,4+:3
(+),2,2<:3,0.0200+:0.282
@@ -295,45 +340,5 @@
(^),2+:3,x,__failed__
(^),2<:3,x,__failed__
(^),2L%3L,x,__failed__
-puts "*** EXACT/INEXACT ***"$$do test (catmap (\op/*0:*/ -> catmap (\a/*0:*/ -> [(op/*1:*/,2,a/*0:*/)] {
- rule #0: a = [(op,2,a)]
- state 0: #0
- <var> state 1
- state 1: #0
-}) [2+:3,2<:3,2%3] {
- rule #0: op = catmap (\a -> [(op,2,a)]) [2+:3,2<:3,2%3]
- state 0: #0
- <var> state 1
- state 1: #0
-}) [(+),(-),(*),(%),(/),(^)])$$do test (catmap (\op/*0:*/ -> catmap (\a/*0:*/ -> [(op/*1:*/,a/*0:*/,2)] {
- rule #0: a = [(op,a,2)]
- state 0: #0
- <var> state 1
- state 1: #0
-}) [2+:3,2<:3,2%3] {
- rule #0: op = catmap (\a -> [(op,a,2)]) [2+:3,2<:3,2%3]
- state 0: #0
- <var> state 1
- state 1: #0
-}) [(+),(-),(*),(%),(/),(^)])$$puts "*** SYMBOLIC ***"$$do test (catmap (\op/*0:*/ -> catmap (\a/*0:*/ -> [(op/*1:*/,x,a/*0:*/)] {
- rule #0: a = [(op,x,a)]
- state 0: #0
- <var> state 1
- state 1: #0
-}) [2+:3,2<:3,2%3] {
- rule #0: op = catmap (\a -> [(op,x,a)]) [2+:3,2<:3,2%3]
- state 0: #0
- <var> state 1
- state 1: #0
-}) [(+),(-),(*),(%),(/),(^)])$$do test (catmap (\op/*0:*/ -> catmap (\a/*0:*/ -> [(op/*1:*/,a/*0:*/,x)] {
- rule #0: a = [(op,a,x)]
- state 0: #0
- <var> state 1
- state 1: #0
-}) [2+:3,2<:3,2%3] {
- rule #0: op = catmap (\a -> [(op,a,x)]) [2+:3,2<:3,2%3]
- state 0: #0
- <var> state 1
- state 1: #0
-}) [(+),(-),(*),(%),(/),(^)]);
+tests;
()
Modified: pure/trunk/test/test021.pure
===================================================================
--- pure/trunk/test/test021.pure 2008-08-23 23:56:43 UTC (rev 595)
+++ pure/trunk/test/test021.pure 2008-08-24 00:11:34 UTC (rev 596)
@@ -26,6 +26,7 @@
show (x<:y) = show x+"<:"+show y;
show x = str x otherwise;
+tests =
puts "*** EXACT/INEXACT ***" $$
// These should all return exact results, except +/- with polar operands, as
// well as / and ^ which always return inexact results.
@@ -35,3 +36,5 @@
// If everything is all right here, these should all print __failed__.
do test [op,x,a;op=[(+),(-),(*),(%),(/),(^)];a=[2+:3,2<:3,2%3]] $$
do test [op,a,x;op=[(+),(-),(*),(%),(/),(^)];a=[2+:3,2<:3,2%3]];
+
+tests;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|