Skip to content

Commit 8d6d8b7

Browse files
committed
Extend test with 0-ary case.
1 parent bcaccfc commit 8d6d8b7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

tests/tests/src/pattern_match_json.mjs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,17 @@ function decodeGroup(group) {
2929
}
3030
}
3131

32+
function decodeNull(x) {
33+
let match = x.field;
34+
if (match !== undefined && match === null) {
35+
return "yes it's null";
36+
} else {
37+
return "no";
38+
}
39+
}
40+
3241
export {
3342
decodeGroup,
43+
decodeNull,
3444
}
3545
/* No side effect */

tests/tests/src/pattern_match_json.res

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,9 @@ let decodeGroup = group => {
1818
| _ => ("e", "f")
1919
}
2020
}
21+
22+
let decodeNull = x =>
23+
switch x {
24+
| dict{"field": Null} => "yes it's null"
25+
| _ => "no"
26+
}

0 commit comments

Comments
 (0)