add a test for fn as operand (#3164)

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2024-07-29 00:33:31 -07:00
committed by GitHub
parent 8880df4fbb
commit fff3c58560

View File

@ -2655,6 +2655,17 @@ const bracket = startSketchOn('XY')
parse_execute(ast).await.unwrap();
}
#[tokio::test(flavor = "multi_thread")]
async fn test_fn_as_operand() {
let ast = r#"fn f = () => { return 1 }
let x = f()
let y = x + 1
let z = f() + 1
let w = f() + f()
"#;
parse_execute(ast).await.unwrap();
}
#[test]
fn test_assign_args_to_params() {
// Set up a little framework for this test.