Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
islonely committed Sep 24, 2023
1 parent 3327fd2 commit 3a1c782
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions vlib/v/tests/lambda_as_struct_field_value_test.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
struct Foo {
sum fn(int, int) int
}

fn test_lambda_as_struct_field_value() {
foo := Foo{
sum: |x, y| x + y
}
assert foo.sum(6, 6) == 12
}

0 comments on commit 3a1c782

Please sign in to comment.