Skip to content

Commit

Permalink
Add semantic test for closure. (#6027)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyalesokhin-starkware authored Jul 16, 2024
1 parent 5474cf3 commit fdd8955
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/cairo-lang-semantic/src/expr/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ cairo_lang_test_utils::test_file_test!(
attributes: "attributes",
constant: "constant",
constructor: "constructor",
closure: "closure",
coupon: "coupon",
enum_: "enum",
error_propagate: "error_propagate",
Expand Down
22 changes: 22 additions & 0 deletions crates/cairo-lang-semantic/src/expr/test_data/closure
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//! > Closure

//! > test_runner_name
test_function_diagnostics(expect_diagnostics: true)

//! > function
fn foo(a: felt252) {
|| {
a
}
}

//! > function_name
foo

//! > module_code

//! > expected_diagnostics
error: Unsupported feature.
--> lib.cairo:2:5
|| {
^**^

0 comments on commit fdd8955

Please sign in to comment.