diff --git a/src/protocol/tests/parser_validation.rs b/src/protocol/tests/parser_validation.rs index f6cb386849c640aa79f36a3f3d96477e9161917b..a3fc6900e3388a8fff3c4f2dc2fa6d2c91b93097 100644 --- a/src/protocol/tests/parser_validation.rs +++ b/src/protocol/tests/parser_validation.rs @@ -347,7 +347,7 @@ fn test_incorrect_union_instance() { " ).error(|e| { e .assert_occurs_at(0, "Foo::A") - .assert_msg_has(0, "failed to fully resolve") + .assert_msg_has(0, "failed to resolve") .assert_occurs_at(1, "false") .assert_msg_has(1, "has been resolved to 's32'") .assert_msg_has(1, "has been resolved to 'bool'"); @@ -734,7 +734,35 @@ fn test_incorrect_goto_statement() { .assert_occurs_at(0, "goto exit;").assert_msg_has(0, "not escape the surrounding sync") .assert_occurs_at(1, "exit: u32 v").assert_msg_has(1, "target of the goto") .assert_occurs_at(2, "sync {").assert_msg_has(2, "jump past this"); - }) + }); + + Tester::new_single_source_expect_err( + "goto jumping to select case", + "primitive f(in i) { + sync select { + hello: auto a = get(i) -> i += 1 + } + goto hello; + }" + ).error(|e| { e + .assert_msg_has(0, "expected '->'"); + }); + + Tester::new_single_source_expect_err( + "goto jumping into select case skipping variable", + "primitive f(in i) { + goto waza; + sync select { + auto a = get(i) -> { + waza: a += 1; + } + } + }" + ).error(|e| { e + .assert_num(1) + .assert_msg_has(0, "not find this label") + .assert_occurs_at(0, "waza;"); + }); } #[test]