summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorkrangelov <kr.angelov@gmail.com>2021-09-22 14:11:11 +0200
committerkrangelov <kr.angelov@gmail.com>2021-09-22 14:11:11 +0200
commit063c517f3c99aa34ebf5ce25a97d85bb05d7abe4 (patch)
tree3e1d228950a6b1b11ab6c3b08294030f2b7a6c63 /testsuite
parent265f08d6eec62e1f30a2a1f6fbc3bc18be17948e (diff)
more tests for variants
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/compiler/compute/Variants.gfs10
-rw-r--r--testsuite/compiler/compute/Variants.gfs.gold10
2 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/compiler/compute/Variants.gfs b/testsuite/compiler/compute/Variants.gfs
index 1f512694c..f65427e88 100644
--- a/testsuite/compiler/compute/Variants.gfs
+++ b/testsuite/compiler/compute/Variants.gfs
@@ -1,2 +1,12 @@
i -retain testsuite/compiler/compute/Variants.gf
cc hello
+cc <\x -> x++x : Str -> Str> ("a"|"b")
+cc <\x -> x : Str -> Str> ("a"|"b")
+cc <\x -> "c" : Str -> Str> ("a"|"b")
+cc <let x = ("a"|"b") in x++x : Str>
+cc <let x = ("a"|"b") in x : Str>
+cc <let x = ("a"|"b") in "c" : Str>
+cc <\x -> x.p1++x.p1 : Str*Str -> Str> <"a"|"b","c">
+cc <\x -> x.p1 : Str*Str -> Str> <"a"|"b","c">
+cc <\x -> x.p2++x.p2 : Str*Str -> Str> <"a"|"b","c">
+cc <\x -> x.p2 : Str*Str -> Str> <"a"|"b","c">
diff --git a/testsuite/compiler/compute/Variants.gfs.gold b/testsuite/compiler/compute/Variants.gfs.gold
index cd74b1c23..50af5e513 100644
--- a/testsuite/compiler/compute/Variants.gfs.gold
+++ b/testsuite/compiler/compute/Variants.gfs.gold
@@ -1 +1,11 @@
variants {"hello"; "hello" ++ "hello"}
+variants {"a" ++ "a"; "b" ++ "b"}
+variants {"a"; "b"}
+"c"
+variants {"a"; "b"} ++ variants {"a"; "b"}
+variants {"a"; "b"}
+"c"
+variants {"a"; "b"} ++ variants {"a"; "b"}
+variants {"a"; "b"}
+"c" ++ "c"
+"c"