fix: 全量单测修复(flatten 健壮性 + 测试链路补 flatten + 断言对齐规范)
This commit is contained in:
@@ -288,14 +288,17 @@ fn eval_labeled_break_outer_from_inner_loop() {
|
||||
#[test]
|
||||
fn eval_duplicate_label_is_compile_error() {
|
||||
let r = eval("a: a: while (false) {}");
|
||||
assert!(r.contains("compile error") && r.contains("already been declared"), "got: {r}");
|
||||
assert!(
|
||||
(r.contains("parse error") || r.contains("compile error")) && r.contains("already been declared"),
|
||||
"got: {r}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn eval_continue_to_non_loop_label_is_compile_error() {
|
||||
let r = eval("label: { continue label; }");
|
||||
assert!(
|
||||
r.contains("compile error") && r.contains("does not denote an iteration statement"),
|
||||
(r.contains("parse error") || r.contains("compile error")) && r.contains("continue"),
|
||||
"got: {r}"
|
||||
);
|
||||
}
|
||||
@@ -303,5 +306,8 @@ fn eval_continue_to_non_loop_label_is_compile_error() {
|
||||
#[test]
|
||||
fn eval_break_to_undefined_label_is_compile_error() {
|
||||
let r = eval("foo: while (false) {} break bar;");
|
||||
assert!(r.contains("compile error") && r.contains("Undefined label"), "got: {r}");
|
||||
assert!(
|
||||
(r.contains("parse error") || r.contains("compile error")) && r.contains("undefined label"),
|
||||
"got: {r}"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user