summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPéter Diviánszky <divipp@gmail.com>2016-11-10 15:24:01 +0100
committerPéter Diviánszky <divipp@gmail.com>2016-11-10 15:24:01 +0100
commit6e11b520ced5d5cc11afc1780f420817d5af9ccb (patch)
tree4270b86e3660913c3f1b75f0ee4c99779525971b
parente9f5a39791b7a074d49d88044be973c986507dba (diff)
add tests for guards + where
-rw-r--r--testdata/language-features/guard/guardWhere01.lc4
-rw-r--r--testdata/language-features/guard/guardWhere01.out21
-rw-r--r--testdata/language-features/guard/guardWhere02.lc9
-rw-r--r--testdata/language-features/guard/guardWhere02.out53
4 files changed, 87 insertions, 0 deletions
diff --git a/testdata/language-features/guard/guardWhere01.lc b/testdata/language-features/guard/guardWhere01.lc
new file mode 100644
index 00000000..537e8923
--- /dev/null
+++ b/testdata/language-features/guard/guardWhere01.lc
@@ -0,0 +1,4 @@
1main
2 | x = True
3 where
4 x = True
diff --git a/testdata/language-features/guard/guardWhere01.out b/testdata/language-features/guard/guardWhere01.out
new file mode 100644
index 00000000..f54041f6
--- /dev/null
+++ b/testdata/language-features/guard/guardWhere01.out
@@ -0,0 +1,21 @@
1main :: Bool
2main = True
3------------ desugared source code
4main
5 = _lhs
6 main
7 let a = True in case'Bool (\(_ :: _) -> _) (_rhs undefined) (_rhs True) a
8------------ core code
9main :: Bool
10main = _rhs True
11------------ tooltips
121:1-1:5
13 Bool
142:7-2:8
15 Bool
162:7-2:15
17 Bool
182:11-2:15
19 Bool
204:9-4:13
21 Bool \ No newline at end of file
diff --git a/testdata/language-features/guard/guardWhere02.lc b/testdata/language-features/guard/guardWhere02.lc
new file mode 100644
index 00000000..687a3368
--- /dev/null
+++ b/testdata/language-features/guard/guardWhere02.lc
@@ -0,0 +1,9 @@
1main
2 | f x = False
3 | f y = True
4 where
5 x = True
6 y = False
7 f True = False
8 f False = True
9
diff --git a/testdata/language-features/guard/guardWhere02.out b/testdata/language-features/guard/guardWhere02.out
new file mode 100644
index 00000000..6921da36
--- /dev/null
+++ b/testdata/language-features/guard/guardWhere02.out
@@ -0,0 +1,53 @@
1main :: Bool
2main = True
3------------ desugared source code
4main
5 = _lhs
6 main
7 let
8 a = True;
9 b = False;
10 c = _lhs f \(d :: _) -> case'Bool (\(_ :: _) -> _) (_rhs True) (_rhs False) d
11 in case'Bool
12 (\(_ :: _) -> _)
13 (case'Bool (\(_ :: _) -> _) (_rhs undefined) (_rhs True) (c b))
14 (_rhs False)
15 (c a)
16------------ core code
17main :: Bool
18main = _rhs True
19------------ tooltips
201:1-1:5
21 Bool
222:7-2:8
23 Bool -> Bool
242:7-2:10
25 Bool
262:7-3:17
27 Bool
282:9-2:10
29 Bool
302:13-2:18
31 Bool
322:13-3:17
33 Bool -> Bool
343:7-3:8
35 Bool -> Bool
363:7-3:10
37 Bool
383:7-3:17
39 Bool
403:9-3:10
41 Bool
423:13-3:17
43 Bool
445:9-5:13
45 Bool
466:9-6:14
47 Bool
487:14-7:19
49 Bool
507:14-8:19
51 Bool -> Bool
528:15-8:19
53 Bool \ No newline at end of file