summaryrefslogtreecommitdiff
path: root/testsuite/runtime/linearize
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-01-12 13:18:37 +0000
committerkrasimir <krasimir@chalmers.se>2010-01-12 13:18:37 +0000
commitf8af5122b5dd1e09288df59e5f6d77705f99b287 (patch)
tree5a859cf1cbf3a2c91b81ae86ae0b94a928437eea /testsuite/runtime/linearize
parent712d079e7c296e4f66bc3d7c30e127b71ecc24d1 (diff)
additional tests for linearizations
Diffstat (limited to 'testsuite/runtime/linearize')
-rw-r--r--testsuite/runtime/linearize/Test.gf13
-rw-r--r--testsuite/runtime/linearize/TestCnc.gf11
-rw-r--r--testsuite/runtime/linearize/linearize.gfs11
-rw-r--r--testsuite/runtime/linearize/linearize.gfs.gold27
4 files changed, 57 insertions, 5 deletions
diff --git a/testsuite/runtime/linearize/Test.gf b/testsuite/runtime/linearize/Test.gf
index 2b7459806..db120bcc3 100644
--- a/testsuite/runtime/linearize/Test.gf
+++ b/testsuite/runtime/linearize/Test.gf
@@ -1,9 +1,16 @@
abstract Test = {
-cat P ;
+cat S ;
cat E ;
-fun Exist : (E -> P) -> P ;
- Even : E -> P ;
+fun Exist : (E -> S) -> S ;
+ Even : E -> S ;
+
+fun a : E ;
+ f,fa,fb : E -> S ;
+
+fun IsString : String -> S ;
+ IsInteger : Int -> S ;
+ IsFloat : Float -> S ;
} \ No newline at end of file
diff --git a/testsuite/runtime/linearize/TestCnc.gf b/testsuite/runtime/linearize/TestCnc.gf
index 025e7af34..81353e35e 100644
--- a/testsuite/runtime/linearize/TestCnc.gf
+++ b/testsuite/runtime/linearize/TestCnc.gf
@@ -4,9 +4,18 @@ param Number = Pl | Sg;
lincat E = {s:Str; n : Number} ;
lindef E = \s -> {s=s; n=Sg} ;
-lincat P = {s:Str} ;
+lincat S = {s:Str} ;
lin Exist f = {s = "exists" ++ f.$0 ++ "such that" ++ f.s};
lin Even x = {s = x.s ++ case x.n of {Sg => "is"; Pl => "are"} ++ "even"};
+lin a = {s = pre {"a"; "aa" / strs {"a"}}; n = Pl} ;
+lin f a = {s = a.s};
+lin fa a = {s = a.s ++ "a"};
+lin fb a = {s = a.s ++ "b"};
+
+lin IsString x = {s = x.s ++ "is string"} ;
+lin IsInteger x = {s = x.s ++ "is integer"} ;
+lin IsFloat x = {s = x.s ++ "is float"} ;
+
} \ No newline at end of file
diff --git a/testsuite/runtime/linearize/linearize.gfs b/testsuite/runtime/linearize/linearize.gfs
index 6ffeb52b6..ba4486217 100644
--- a/testsuite/runtime/linearize/linearize.gfs
+++ b/testsuite/runtime/linearize/linearize.gfs
@@ -1,3 +1,12 @@
i -src testsuite/runtime/linearize/TestCnc.gf
-l Exist (\x -> Even x)
+l Even ?
+l Exist (\x -> <Even : E -> S> x)
+l f a
+l fa a
+l fb a
+l IsString "abcd"
+l IsInteger 100
+l IsFloat 12.4
+l <IsString "xyz" : S>
+l <\x -> x : S -> S> \ No newline at end of file
diff --git a/testsuite/runtime/linearize/linearize.gfs.gold b/testsuite/runtime/linearize/linearize.gfs.gold
index 22477a5ba..90630ee0b 100644
--- a/testsuite/runtime/linearize/linearize.gfs.gold
+++ b/testsuite/runtime/linearize/linearize.gfs.gold
@@ -1,3 +1,30 @@
+?1 is even
+
+
exists x such that x is even
+a
+
+
+aa a
+
+
+a b
+
+
+abcd is string
+
+
+100 is integer
+
+
+12.4 is float
+
+
+xyz is string
+
+
+
+
+