Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Dec 15, 2024
1 parent aee0683 commit f5fd6f4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vlib/v/tests/array_fixed_none_init_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ fn test_none_init() {
assert c == none
}

fn foo() u8 {
return 123
}

fn test_non_none_init() {
c := ?[3]u8{init: 2}
assert c? == [u8(2), 2, 2]!
assert c != none

d := ?[3]u8{init: foo()}
assert d? == [u8(123), 123, 123]!
}

0 comments on commit f5fd6f4

Please sign in to comment.