[fine] Tweak syntax for assertions to make me happier

This commit is contained in:
John Doty 2024-01-06 07:54:00 -08:00
parent 758aef4db9
commit 8835d9eaf2
12 changed files with 104 additions and 25 deletions

View file

@ -17,7 +17,7 @@ fn generate_test_for_file(path: PathBuf) -> String {
};
let line = line.trim();
if line == "concrete:" {
if line == "@concrete:" {
let mut concrete = String::new();
while let Some(line) = lines.next() {
let line = match line.strip_prefix("// | ") {
@ -32,7 +32,7 @@ fn generate_test_for_file(path: PathBuf) -> String {
assertions.push(quote! {
crate::assert_concrete(&_tree, #concrete, #display_path);
});
} else if let Some(line) = line.strip_prefix("type:") {
} else if let Some(line) = line.strip_prefix("@type:") {
let (pos, expected) = line
.trim()
.split_once(' ')
@ -45,7 +45,7 @@ fn generate_test_for_file(path: PathBuf) -> String {
assertions.push(quote! {
crate::assert_type_at(&_tree, &_lines, #pos, #expected, #display_path);
});
} else if let Some(line) = line.strip_prefix("type-error:") {
} else if let Some(line) = line.strip_prefix("@type-error:") {
let (pos, expected) = line
.trim()
.split_once(' ')