[fine] OK
This commit is contained in:
parent
50eb7a9673
commit
65fef78c44
10 changed files with 81 additions and 25 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use fine::compiler::{compile, Function, Module};
|
||||
use fine::parser::SyntaxTree;
|
||||
use fine::semantics::{Semantics, Type};
|
||||
use fine::semantics::{check, Error, Semantics, Type};
|
||||
use fine::tokens::Lines;
|
||||
use pretty_assertions::assert_eq;
|
||||
use std::fmt::Write as _;
|
||||
|
|
@ -243,4 +243,19 @@ fn assert_compiles_to(tree: &SyntaxTree, lines: &Lines, expected: &str, source_p
|
|||
}
|
||||
}
|
||||
|
||||
fn assert_no_errors(tree: &SyntaxTree, lines: &Lines) {
|
||||
let semantics = Semantics::new(tree, lines);
|
||||
check(&semantics);
|
||||
|
||||
let expected_errors: Vec<Error> = Vec::new();
|
||||
let errors = semantics.snapshot_errors();
|
||||
semantic_assert_eq!(
|
||||
&semantics,
|
||||
None,
|
||||
expected_errors,
|
||||
errors,
|
||||
"expected no errors"
|
||||
);
|
||||
}
|
||||
|
||||
include!(concat!(env!("OUT_DIR"), "/generated_tests.rs"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue