Skip to content

Commit 5c0a68a

Browse files
committed
Add test! for conditional return type
1 parent 85f5572 commit 5c0a68a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/tests.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,21 @@ fn test_ast_gen() -> Result<(), Box<dyn std::error::Error>> {
258258
259259
260260
261+
");
262+
263+
test!("tests/test_if_return_type.ql",
264+
"|_ test_if_return_type // @test_if_return_type.ql:1:1
265+
|_ fn test_if_return_type$unfair_toss (b: bit) : qubit // @test_if_return_type.ql:1:4
266+
|_ b
267+
|_ True
268+
|_ 0q0_1
269+
|_ False
270+
|_ 0q1_0
271+
272+
273+
|_ fn test_if_return_type$main () : qubit // @test_if_return_type.ql:9:4
274+
|_ choice: qubit = test_if_return_type$unfair_toss: qubit (1)
275+
261276
");
262277

263278
test!("tests/test_binary_expressions.ql",

0 commit comments

Comments
 (0)