Skip to content

Commit 94db27c

Browse files
committed
add test for accept with a semicolon (issue #88)
1 parent 5ac8e28 commit 94db27c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/codegen/tests.rs

+19
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,25 @@ fn accept() {
5555
assert_eq!(res, Verdict::Accept(()));
5656
}
5757

58+
#[test]
59+
fn accept_with_semicolon() {
60+
let s = src!(
61+
"
62+
filtermap main() {
63+
accept;
64+
}
65+
"
66+
);
67+
68+
let mut p = compile(s);
69+
let f = p
70+
.get_function::<(), (), Verdict<(), ()>>("main")
71+
.expect("No function found (or mismatched types)");
72+
73+
let res = f.call(&mut ());
74+
assert_eq!(res, Verdict::Accept(()));
75+
}
76+
5877
#[test]
5978
fn reject() {
6079
let s = src!(

0 commit comments

Comments
 (0)