Skip to content

Commit 854656a

Browse files
authored
Merge pull request #1796 from ironm00n/fix/type-check-because
fix: type checking check operators with `because`
2 parents 0531910 + 4e44ecf commit 854656a

File tree

4 files changed

+60
-5
lines changed

4 files changed

+60
-5
lines changed

src/js/trove/global.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,31 @@
5454
"current-checker": ["arrow", [], ["record", {
5555
"run-checks": "tbot",
5656
"check-is": "tbot",
57-
"check-is-not": "tbot",
57+
"check-is-cause": "tbot",
5858
"check-is-roughly": "tbot",
59+
"check-is-roughly-cause": "tbot",
60+
"check-is-not": "tbot",
61+
"check-is-not-cause": "tbot",
5962
"check-is-refinement": "tbot",
63+
"check-is-refinement-cause": "tbot",
6064
"check-is-not-refinement": "tbot",
61-
"check-satisfies": "tbot",
65+
"check-is-not-refinement-cause": "tbot",
66+
"check-satisfies": "tbot", // doesn't have -cause
67+
"check-satisfies-not": "tbot", // doesn't have -cause
6268
"check-satisfies-delayed": "tbot",
63-
"check-satisfies-not": "tbot",
69+
"check-satisfies-delayed-cause": "tbot",
6470
"check-satisfies-not-delayed": "tbot",
71+
"check-satisfies-not-delayed-cause": "tbot",
6572
"check-raises-str": "tbot",
66-
"check-raises-not": "tbot",
73+
"check-raises-str-cause": "tbot",
6774
"check-raises-other-str": "tbot",
75+
"check-raises-other-str-cause": "tbot",
76+
"check-raises-not": "tbot",
77+
"check-raises-not-cause": "tbot",
6878
"check-raises-satisfies": "tbot",
69-
"check-raises-violates": "tbot"
79+
"check-raises-satisfies-cause": "tbot",
80+
"check-raises-violates": "tbot",
81+
"check-raises-violates-cause": "tbot"
7082
}]]
7183
}],
7284

File renamed without changes.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
check:
2+
fun less-than(l :: Number, r :: Number): l < r end
3+
fun is-even(n :: Number): num-modulo(n, 2) == 0 end
4+
5+
67 is 67
6+
67 is 67 because 67
7+
8+
~0.0000001 is-roughly ~0.0000002
9+
~0.0000001 is-roughly ~0.0000002 because ~0.0000001
10+
11+
67 is-not 69
12+
67 is-not 69 because 67
13+
14+
67 is%(less-than) 69
15+
67 is%(less-than) 69 because 67
16+
17+
69 is-not%(less-than) 67
18+
69 is-not%(less-than) 67 because 69
19+
20+
67 + 1 satisfies is-even
21+
67 + 1 satisfies is-even because 68
22+
23+
70 - 1 violates is-even
24+
70 - 1 violates is-even because 69
25+
26+
raise("err") raises "err"
27+
raise("err") raises "err" because raise("err")
28+
29+
raise("foo") raises-other-than "bar"
30+
raise("foo") raises-other-than "bar" because raise("foo")
31+
32+
67 does-not-raise
33+
67 does-not-raise because 67
34+
35+
fun is-foo(x :: Any): x == "foo" end
36+
37+
raise("foo") raises-satisfies is-foo
38+
raise("foo") raises-satisfies is-foo because raise("foo")
39+
40+
raise("bar") raises-violates is-foo
41+
raise("bar") raises-violates is-foo because raise("bar")
42+
end
43+

0 commit comments

Comments
 (0)