Skip to content

Commit

Permalink
tests: test call of variadic function with no arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexesprit authored Apr 11, 2020
1 parent 4b02956 commit 0f19f9d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions vlib/v/tests/fn_variadic_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,20 @@ fn test_fn_variadic_forward() {
assert variadic_forward_a('a','b','c') == 'abc'
}

fn variadic_test_no_args(name string, groups ...VaTestGroup) {
fn fn_variadic_with_arg_no_vargs(name string, groups ...VaTestGroup) {
assert groups.len == 0
}

fn test_fn_variadic_no_args() {
variadic_test_no_args('marko')
fn test_fn_variadic_with_arg_no_vargs() {
fn_variadic_with_arg_no_vargs('marko')
}

fn fn_variadic_only_with_no_vargs(groups ...VaTestGroup) {
assert groups.len == 0
}

fn test_variadic_only_with_no_vargs() {
fn_variadic_only_with_no_vargs()
}

struct VaTestStruct {}
Expand Down

0 comments on commit 0f19f9d

Please sign in to comment.