Fix sending detection

This commit is contained in:
0x4261756D
2022-12-19 12:13:40 +01:00
parent f60441ef9d
commit 2255aaff8b
2 changed files with 68 additions and 4 deletions

View File

@ -107,12 +107,12 @@ fn main()
{
let f = f.unwrap();
let file_content = fs::read_to_string(f.path()).unwrap();
println!("========NOW TESTING '{:?}'========", f.path());
println!("========NOW TESTING {:?}========", f.path());
match compile(&file_content, &intrinsics, interpret, debug)
{
Ok(maybe_msg) =>
{
println!("---Successfully parsed '{:?}'---", f.path());
println!("---Successfully parsed {:?}---", f.path());
if let Some(msg) = &maybe_msg
{
print!("---Output---\n'{}'\n", msg);
@ -141,14 +141,14 @@ fn main()
println!("===PASSED===");
count += 1;
}
else if let Some(index) = file_content.find(":END:")
else if let Some(index) = file_content.find("//:END:")
{
let expected_output = file_content[10..index].replace("\n//", "\n");
println!("\n\n===FAILED===\nExpected the output to be {}", expected_output);
}
else
{
panic!("Could not find an ending marker (//:END:) for the expected output in {:?}", f.file_name());
panic!("Could not find an ending marker (:END:) for the expected output in {:?}", f.file_name());
}
}
}