summaryrefslogtreecommitdiff
path: root/testsuite/tests/programs/rittri
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/programs/rittri')
-rw-r--r--testsuite/tests/programs/rittri/Main.hs39
-rw-r--r--testsuite/tests/programs/rittri/Makefile3
-rw-r--r--testsuite/tests/programs/rittri/rittri.stdin39
-rw-r--r--testsuite/tests/programs/rittri/rittri.stdout39
-rw-r--r--testsuite/tests/programs/rittri/test.T6
5 files changed, 126 insertions, 0 deletions
diff --git a/testsuite/tests/programs/rittri/Main.hs b/testsuite/tests/programs/rittri/Main.hs
new file mode 100644
index 0000000000..e62c8a4667
--- /dev/null
+++ b/testsuite/tests/programs/rittri/Main.hs
@@ -0,0 +1,39 @@
+infixr ->!,=\
+
+-- auxiliary functions -----------------------------------------------------
+
+g u v w (x:y:z) = i(v x y)(u x y (w z) z)(x:w(y:z))
+g u v w [x] = [x,512]
+q u v w nil = u : 95 : z v : w
+
+long = several.length
+((->!),(=\))=(map,($))
+a = g q f
+y = (-)32
+z = (+)32
+several = (>)2
+fairlySmall = (<)64
+notTooSmall = (>)91
+justRight = (==)95
+notTooBig = (<)96
+veryBig = (>)123
+goodSize x =foldr(&&)
+ otherwise =\($x)->![notTooBig,veryBig]
+f y z =fairlySmall(z)&&goodSize(y)&&notTooSmall(z)
+i cond th el=if(cond)then(th)else(el)
+toBeIsToDoAndToDoIsToBeSaidConFuTse
+
+-- main functions ----------------------------------------------------------
+
+ g = interact$map
+ toEnum.g.map
+ fromEnum
+main =
+ toBeIsToDoAndToDoIsToBeSaidConFuTse(let h=a;t=x where x x=i(long x)x(h t x)
+ q v w x z = - y w:x
+ a = g q f
+ f x y = justRight x
+ && goodSize y
+ in t)
+
+-- rittri@cs.chalmers.se ---------------------------------------------------
diff --git a/testsuite/tests/programs/rittri/Makefile b/testsuite/tests/programs/rittri/Makefile
new file mode 100644
index 0000000000..9101fbd40a
--- /dev/null
+++ b/testsuite/tests/programs/rittri/Makefile
@@ -0,0 +1,3 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/programs/rittri/rittri.stdin b/testsuite/tests/programs/rittri/rittri.stdin
new file mode 100644
index 0000000000..84e5ba190d
--- /dev/null
+++ b/testsuite/tests/programs/rittri/rittri.stdin
@@ -0,0 +1,39 @@
+infixr ->!,=\
+
+-- auxiliary functions -----------------------------------------------------
+
+g u v w (x:y:z) = i(v x y)(u x y (w z) z)(x:w(y:z))
+g u v w [x] = [x,512]
+q u v w nil = u : 95 : z v : w
+
+long = several.length
+((->!),(=\))=(map,($))
+a = g q f
+y = (-)32
+z = (+)32
+several = (>)2
+fairlySmall = (<)64
+notTooSmall = (>)91
+justRight = (==)95
+notTooBig = (<)96
+veryBig = (>)123
+goodSize x =foldr(&&)
+ otherwise =\($x)->![notTooBig,veryBig]
+f y z =fairlySmall(z)&&goodSize(y)&&notTooSmall(z)
+i cond th el=if(cond)then(th)else(el)
+toBeIsToDoAndToDoIsToBeSaidConFuTse
+
+-- main functions ----------------------------------------------------------
+
+ g = interact$map
+ chr.g.map
+ ord
+main =
+ toBeIsToDoAndToDoIsToBeSaidConFuTse(let h=a;t=x where x x=i(long x)x(h t x)
+ q v w x z =- y w:x
+ a = g q f
+ f x y = justRight x
+ && goodSize y
+ in t)
+
+-- rittri@cs.chalmers.se ---------------------------------------------------
diff --git a/testsuite/tests/programs/rittri/rittri.stdout b/testsuite/tests/programs/rittri/rittri.stdout
new file mode 100644
index 0000000000..c904cda513
--- /dev/null
+++ b/testsuite/tests/programs/rittri/rittri.stdout
@@ -0,0 +1,39 @@
+infixr ->!,=\
+
+-- auxiliary functions -----------------------------------------------------
+
+g u v w (x:y:z) = i(v x y)(u x y (w z) z)(x:w(y:z))
+g u v w [x] = [x,512]
+q u v w nil = u : 95 : z v : w
+
+long = several.length
+((->!),(=\))=(map,($))
+a = g q f
+y = (-)32
+z = (+)32
+several = (>)2
+fairly_small = (<)64
+not_too_small = (>)91
+just_right = (==)95
+not_too_big = (<)96
+very_big = (>)123
+good_size x =foldr(&&)
+ otherwise =\($x)->![not_too_big,very_big]
+f y z =fairly_small(z)&&good_size(y)&&not_too_small(z)
+i cond th el=if(cond)then(th)else(el)
+to_be_is_to_do_and_to_do_is_to_be_said_con_fu_tse
+
+-- main functions ----------------------------------------------------------
+
+ g = interact$map
+ chr.g.map
+ ord
+main =
+ to_be_is_to_do_and_to_do_is_to_be_said_con_fu_tse(let h=a;t=x where x x=i(long x)x(h t x)
+ q v w x z =- y w:x
+ a = g q f
+ f x y = just_right x
+ && good_size y
+ in t)
+
+-- rittri@cs.chalmers.se ---------------------------------------------------
diff --git a/testsuite/tests/programs/rittri/test.T b/testsuite/tests/programs/rittri/test.T
new file mode 100644
index 0000000000..2e14f6fdcc
--- /dev/null
+++ b/testsuite/tests/programs/rittri/test.T
@@ -0,0 +1,6 @@
+
+test('rittri',
+ [skip_if_fast, extra_clean(['Main.hi', 'Main.o'])],
+ multimod_compile_and_run,
+ ['Main', ''])
+