Compare commits
No commits in common. "53f18e729baef217a0744b9586bdf6fba6edbe61" and "65fef78c44f6c224bb9c6fa29415b6782bc33ac9" have entirely different histories.
53f18e729b
...
65fef78c44
8 changed files with 35 additions and 54 deletions
|
|
@ -82,8 +82,6 @@ fn generate_test_for_file(path: PathBuf) -> String {
|
||||||
assertions.push(quote! {
|
assertions.push(quote! {
|
||||||
crate::assert_no_errors(&_tree, &_lines);
|
crate::assert_no_errors(&_tree, &_lines);
|
||||||
});
|
});
|
||||||
} else if line.starts_with("@") {
|
|
||||||
panic!("Test file {display_path} has unknown directive: {line}");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@ fun foo(x: f64) {
|
||||||
x + 7
|
x + 7
|
||||||
}
|
}
|
||||||
|
|
||||||
// @no-errors
|
|
||||||
// @type: 20 f64
|
// @type: 20 f64
|
||||||
// @concrete:
|
// @concrete:
|
||||||
// | File
|
// | File
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
1 * 2 + -3 * 4;
|
1 * 2 + -3 * 4;
|
||||||
|
|
||||||
// @no-errors
|
|
||||||
// @type: 6 f64
|
// @type: 6 f64
|
||||||
// @concrete:
|
// @concrete:
|
||||||
// | File
|
// | File
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
{}
|
|
||||||
|
|
||||||
// @no-errors
|
|
||||||
// @type: 0 ()
|
|
||||||
// @concrete:
|
// @concrete:
|
||||||
// | File
|
// | File
|
||||||
// | Block
|
// | Block
|
||||||
// | LeftBrace:'"{"'
|
// | LeftBrace:'"{"'
|
||||||
// | RightBrace:'"}"'
|
// | RightBrace:'"}"'
|
||||||
// |
|
// |
|
||||||
|
|
||||||
|
{}
|
||||||
|
|
||||||
|
// @type: 94 ()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
true and false or false and !true;
|
|
||||||
|
|
||||||
// @no-errors
|
|
||||||
// @type: 15 bool
|
|
||||||
// @concrete:
|
// @concrete:
|
||||||
// | File
|
// | File
|
||||||
// | ExpressionStatement
|
// | ExpressionStatement
|
||||||
|
|
@ -22,3 +18,7 @@ true and false or false and !true;
|
||||||
// | LiteralExpression
|
// | LiteralExpression
|
||||||
// | True:'"true"'
|
// | True:'"true"'
|
||||||
// | Semicolon:'";"'
|
// | Semicolon:'";"'
|
||||||
|
//
|
||||||
|
true and false or false and !true;
|
||||||
|
|
||||||
|
// @type: 549 bool
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,3 @@
|
||||||
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:
|
// @concrete:
|
||||||
// | File
|
// | File
|
||||||
// | IfStatement
|
// | IfStatement
|
||||||
|
|
@ -44,16 +23,22 @@ if true { "discarded"; 23 } else { 45 }
|
||||||
// | Number:'"45"'
|
// | Number:'"45"'
|
||||||
// | RightBrace:'"}"'
|
// | RightBrace:'"}"'
|
||||||
//
|
//
|
||||||
// @compiles-to:
|
if true { "discarded"; 23 } else { 45 }
|
||||||
// | function << module >> (0 args, 0 locals):
|
|
||||||
// | strings (1):
|
// Here come some type probes!
|
||||||
// | 0: "discarded"
|
// (type of the condition)
|
||||||
// | code (7):
|
// @type: 667 bool
|
||||||
// | 0: PushTrue
|
//
|
||||||
// | 1: JumpFalse(6)
|
// (the discarded expression)
|
||||||
// | 2: PushString(0)
|
// @type: 674 string
|
||||||
// | 3: Discard
|
//
|
||||||
// | 4: PushFloat(23.0)
|
// (the "then" clause)
|
||||||
// | 5: Jump(7)
|
// @type: 686 f64
|
||||||
// | 6: PushFloat(45.0)
|
// @type: 689 f64
|
||||||
// |
|
//
|
||||||
|
// (the "else" clause)
|
||||||
|
// @type: 696 f64
|
||||||
|
// @type: 699 f64
|
||||||
|
//
|
||||||
|
// (the overall expression)
|
||||||
|
// @type: 664 f64
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
42;
|
|
||||||
|
|
||||||
// @no-errors
|
|
||||||
// @type: 0 f64
|
|
||||||
// @concrete:
|
// @concrete:
|
||||||
// | File
|
// | File
|
||||||
// | ExpressionStatement
|
// | ExpressionStatement
|
||||||
// | LiteralExpression
|
// | LiteralExpression
|
||||||
// | Number:'"42"'
|
// | Number:'"42"'
|
||||||
// | Semicolon:'";"'
|
// | Semicolon:'";"'
|
||||||
|
|
||||||
|
42;
|
||||||
|
|
||||||
|
// @type: 129 f64
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,3 @@
|
||||||
"Hello " + 'world!';
|
|
||||||
|
|
||||||
// @no-errors
|
|
||||||
// @type: 9 string
|
|
||||||
// @concrete:
|
// @concrete:
|
||||||
// | File
|
// | File
|
||||||
// | ExpressionStatement
|
// | ExpressionStatement
|
||||||
|
|
@ -12,3 +8,7 @@
|
||||||
// | LiteralExpression
|
// | LiteralExpression
|
||||||
// | String:'"'world!'"'
|
// | String:'"'world!'"'
|
||||||
// | Semicolon:'";"'
|
// | Semicolon:'";"'
|
||||||
|
//
|
||||||
|
"Hello " + 'world!';
|
||||||
|
|
||||||
|
// @type: 261 string
|
||||||
Loading…
Add table
Add a link
Reference in a new issue