Skip to content

Commit f260b54

Browse files
committed
tweak test
1 parent ffebcc0 commit f260b54

File tree

2 files changed

+36
-32
lines changed

2 files changed

+36
-32
lines changed

analysis/tests/src/Actions.res

+10-9
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
type kind = First | Second | Third
22
type r = {name: string, age: int}
33

4-
let _ = (kind, kindStr) => {
5-
let _ifThenElse = if kind == First {
6-
// ^act
7-
"First"
8-
} else {
9-
"Not First"
10-
}
4+
let ret = _ => assert false
5+
let kind = assert false
116

12-
let _ternary = #kind("First", {name: "abc", age: 3}) != kindStr ? "Not First" : "First"
13-
// ^act
7+
if kind == First {
8+
// ^act
9+
ret("First")
10+
} else {
11+
ret("Not First")
1412
}
13+
14+
#kind("First", {name: "abc", age: 3}) != kind ? ret("Not First") : ret("First")
15+
// ^act
+26-23
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
1-
Actions tests/src/Actions.res 4:20
1+
Actions tests/src/Actions.res 6:5
22
Formatted:
33
type kind = First | Second | Third
44
type r = {name: string, age: int}
55

6-
let _ = (kind, kindStr) => {
7-
let _ifThenElse = switch kind {
8-
| First => // ^act
9-
"First"
10-
| _ => "Not First"
11-
}
6+
let ret = _ => assert false
7+
let kind = assert false
128

13-
let _ternary = #kind("First", {name: "abc", age: 3}) != kindStr ? "Not First" : "First"
14-
// ^act
9+
switch kind {
10+
| First =>
11+
// ^act
12+
ret("First")
13+
| _ => ret("Not First")
1514
}
1615

17-
Actions tests/src/Actions.res 11:17
16+
#kind("First", {name: "abc", age: 3}) != kind ? ret("Not First") : ret("First")
17+
// ^act
18+
19+
Actions tests/src/Actions.res 13:15
1820
Formatted:
1921
type kind = First | Second | Third
2022
type r = {name: string, age: int}
2123

22-
let _ = (kind, kindStr) => {
23-
let _ifThenElse = if kind == First {
24-
// ^act
25-
"First"
26-
} else {
27-
"Not First"
28-
}
29-
30-
let _ternary = switch kindStr {
31-
| #kind("First", {name: "abc", age: 3}) => "First"
32-
| _ => "Not First"
33-
}
34-
// ^act
24+
let ret = _ => assert false
25+
let kind = assert false
26+
27+
if kind == First {
28+
// ^act
29+
ret("First")
30+
} else {
31+
ret("Not First")
32+
}
33+
34+
switch kind {
35+
| #kind("First", {name: "abc", age: 3}) => ret("First")
36+
// ^act
37+
| _ => ret("Not First")
3538
}
3639

0 commit comments

Comments
 (0)