Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Mar 27, 2024
1 parent 57fecb3 commit f00c9e3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions vlib/v/checker/tests/option_multi_return_err.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
vlib/v/checker/tests/option_multi_return_err.vv:6:14: error: split() returns `?(string, string)`, so it should have either an `or {}` block, or `?` at the end
4 |
5 | fn main() {
6 | foo, bar := split('foo/bar')
| ~~~~~~~~~~~~~~~~
7 | println('${foo}.${bar}')
8 | }
8 changes: 8 additions & 0 deletions vlib/v/checker/tests/option_multi_return_err.vv
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fn split(str string) ?(string, string) {
return none
}

fn main() {
foo, bar := split('foo/bar')
println('${foo}.${bar}')
}

0 comments on commit f00c9e3

Please sign in to comment.