diff --git a/src/protocol/tests/parser_validation.rs b/src/protocol/tests/parser_validation.rs index 6cc4e99196c67d163d5265831256da171defe96e..a6c63495b33f7bace49de11de94829744a70b7f1 100644 --- a/src/protocol/tests/parser_validation.rs +++ b/src/protocol/tests/parser_validation.rs @@ -592,8 +592,31 @@ fn test_variable_introduction_in_scope() { #[test] fn test_correct_select_statement() { + + Tester::new_single_source_expect_ok( + "guard variable decl", + " + primitive f() { + channel unused -> input; + + u32 outer_value = 0; + sync select { + auto in_same_guard = get(input) -> {} // decl A1 + auto in_same_gaurd = get(input) -> {} // decl A2 + auto in_guard_and_block = get(input) -> {} // decl B1 + outer_value = get(input) -> { auto in_guard_and_block = outer_value; } // decl B2 + } + } + " + ); + + Tester::new_single_source_expect_ok( + "empty select", + "primitive f() { sync select {} }" + ); + Tester::new_single_source_expect_ok( - "correct single-use", " + "mixed uses", " primitive f() { channel unused_output -> input; u32 outer_value = 0;