Fix broken tests

This commit is contained in:
Shunsuke Shibayama 2022-12-25 12:37:41 +09:00
parent 46418987c1
commit 099b4587e5
10 changed files with 29 additions and 89 deletions

View file

@ -1,5 +1,6 @@
use erg_common::config::{ErgConfig, Input};
use erg_common::error::MultiErrorDisplay;
use erg_common::spawn::exec_new_thread;
use erg_common::traits::Runnable;
use erg_parser::error::ParserRunnerErrors;
@ -51,7 +52,7 @@ fn parse_test2_advanced_syntax() -> Result<(), ParserRunnerErrors> {
expect_success("tests/test2_advanced_syntax.er")
}
fn parse_test_from_code(file_path: &'static str) -> Result<(), ParserRunnerErrors> {
fn _parse_test_from_code(file_path: &'static str) -> Result<(), ParserRunnerErrors> {
let input = Input::File(file_path.into());
let cfg = ErgConfig {
input: input.clone(),
@ -76,6 +77,10 @@ fn parse_test_from_code(file_path: &'static str) -> Result<(), ParserRunnerError
}
}
fn parse_test_from_code(file_path: &'static str) -> Result<(), ParserRunnerErrors> {
exec_new_thread(move || _parse_test_from_code(file_path))
}
fn expect_success(file_path: &'static str) -> Result<(), ParserRunnerErrors> {
match parse_test_from_code(file_path) {
Ok(_) => Ok(()),