Skip to content

Commit

Permalink
add test pair
Browse files Browse the repository at this point in the history
  • Loading branch information
spytheman committed Oct 27, 2024
1 parent b219038 commit 17a5551
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
vlib/v/tests/skip_unused/assert_of_sumtype_values_works_test.vv:5: fn test_ab
> assert a == b
Left value (len: 6): `Sum(1)`
Right value (len: 6): `Sum(2)`

vlib/v/tests/skip_unused/assert_of_sumtype_values_works_test.vv:9: fn test_sumtype_literals
> assert main.Sum(1) == main.Sum(2)
Left value (len: 11): `main.Sum(1)`
Right value (len: 11): `main.Sum(2)`

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
vlib/v/tests/skip_unused/assert_of_sumtype_values_works_test.vv:5: fn test_ab
> assert a == b
Left value (len: 6): `Sum(1)`
Right value (len: 6): `Sum(2)`

vlib/v/tests/skip_unused/assert_of_sumtype_values_works_test.vv:9: fn test_sumtype_literals
> assert main.Sum(1) == main.Sum(2)
Left value (len: 11): `main.Sum(1)`
Right value (len: 11): `main.Sum(2)`

10 changes: 10 additions & 0 deletions vlib/v/tests/skip_unused/assert_of_sumtype_values_works_test.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type Sum = int | string

fn test_ab() {
a, b := Sum(1), Sum(2)
assert a == b
}

fn test_sumtype_literals() {
assert Sum(1) == Sum(2)
}

0 comments on commit 17a5551

Please sign in to comment.