[fine] Fiddle with tests, no errors

This commit is contained in:
John Doty 2024-01-14 07:05:01 -08:00
parent 65fef78c44
commit 4be4572574
8 changed files with 41 additions and 35 deletions

View file

@ -82,6 +82,8 @@ fn generate_test_for_file(path: PathBuf) -> String {
assertions.push(quote! {
crate::assert_no_errors(&_tree, &_lines);
});
} else if line.starts_with("@") {
panic!("Test file {display_path} has unknown directive: {line}");
}
}

View file

@ -2,6 +2,7 @@ fun foo(x: f64) {
x + 7
}
// @no-errors
// @type: 20 f64
// @concrete:
// | File

View file

@ -1,5 +1,6 @@
1 * 2 + -3 * 4;
// @no-errors
// @type: 6 f64
// @concrete:
// | File

View file

@ -1,10 +1,10 @@
{}
// @no-errors
// @type: 0 ()
// @concrete:
// | File
// | Block
// | LeftBrace:'"{"'
// | RightBrace:'"}"'
// |
{}
// @type: 94 ()

View file

@ -1,3 +1,7 @@
true and false or false and !true;
// @no-errors
// @type: 15 bool
// @concrete:
// | File
// | ExpressionStatement
@ -18,7 +22,3 @@
// | LiteralExpression
// | True:'"true"'
// | Semicolon:'";"'
//
true and false or false and !true;
// @type: 549 bool

View file

@ -1,3 +1,24 @@
if true { "discarded"; 23 } else { 45 }
// @no-errors
// Here come some type probes!
// (type of the condition)
// @type: 3 bool
//
// (the discarded expression)
// @type: 10 string
//
// (the "then" clause)
// @type: 23 f64
// @type: 26 f64
//
// (the "else" clause)
// @type: 35 f64
// @type: 38 f64
//
// (the overall expression)
// @type: 0 f64
//
// @concrete:
// | File
// | IfStatement
@ -23,22 +44,3 @@
// | Number:'"45"'
// | RightBrace:'"}"'
//
if true { "discarded"; 23 } else { 45 }
// Here come some type probes!
// (type of the condition)
// @type: 667 bool
//
// (the discarded expression)
// @type: 674 string
//
// (the "then" clause)
// @type: 686 f64
// @type: 689 f64
//
// (the "else" clause)
// @type: 696 f64
// @type: 699 f64
//
// (the overall expression)
// @type: 664 f64

View file

@ -1,10 +1,10 @@
42;
// @no-errors
// @type: 0 f64
// @concrete:
// | File
// | ExpressionStatement
// | LiteralExpression
// | Number:'"42"'
// | Semicolon:'";"'
42;
// @type: 129 f64

View file

@ -1,3 +1,7 @@
"Hello " + 'world!';
// @no-errors
// @type: 9 string
// @concrete:
// | File
// | ExpressionStatement
@ -8,7 +12,3 @@
// | LiteralExpression
// | String:'"'world!'"'
// | Semicolon:'";"'
//
"Hello " + 'world!';
// @type: 261 string