[fine] Assignments!
And new error capabilities!
This commit is contained in:
parent
92cf840766
commit
f20f5a5e03
12 changed files with 400 additions and 64 deletions
|
|
@ -283,6 +283,25 @@ fn assert_eval_ok(tree: &SyntaxTree, lines: &Lines, expected: &str) {
|
|||
}
|
||||
}
|
||||
|
||||
fn assert_errors(tree: &SyntaxTree, lines: &Lines, expected_errors: Vec<&str>) {
|
||||
let semantics = Semantics::new(tree, lines);
|
||||
check(&semantics);
|
||||
|
||||
let errors: Vec<String> = semantics
|
||||
.snapshot_errors()
|
||||
.iter()
|
||||
.map(|e| format!("{}", e))
|
||||
.collect();
|
||||
|
||||
semantic_assert_eq!(
|
||||
&semantics,
|
||||
None,
|
||||
expected_errors,
|
||||
errors,
|
||||
"expected no errors"
|
||||
);
|
||||
}
|
||||
|
||||
fn assert_check_error(tree: &SyntaxTree, lines: &Lines, expected: &str) {
|
||||
let semantics = Semantics::new(tree, lines);
|
||||
check(&semantics);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue