Skip to content

Commit

Permalink
improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Dec 30, 2024
1 parent e51cce1 commit 4d480f8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vlib/v/tests/generics/generic_fn_array_infer_var_test.v
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fn function_that_receives_an_array_of_generic_type[T](array []T) {
return
assert array.len == 0
}

fn function_that_returns_an_array_of_generic_type[T]() []T {
Expand All @@ -9,10 +9,12 @@ fn function_that_returns_an_array_of_generic_type[T]() []T {
fn func[T]() {
res := function_that_returns_an_array_of_generic_type[T]()
function_that_receives_an_array_of_generic_type(res)
assert res.len == 0
function_that_receives_an_array_of_generic_type[T](res)
return
}

fn test_main() {
func[string]()
func[int]()
func[f64]()
}

0 comments on commit 4d480f8

Please sign in to comment.