-
-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue-677: support task creation with variadic args #755
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -899,6 +899,26 @@ func TestScheduler_NewJobTask(t *testing.T) { | |
NewTask(&testFuncWithParams, "one", "two"), | ||
nil, | ||
}, | ||
{ | ||
"parameter type does not match - different argument types against variadic parameters", | ||
NewTask(func(args ...string) {}, "one", 2), | ||
ErrNewJobWrongTypeOfParameters, | ||
}, | ||
{ | ||
"all good string - variadic", | ||
NewTask(func(args ...string) {}, "one", "two"), | ||
nil, | ||
}, | ||
{ | ||
"all good struct - variadic", | ||
NewTask(func(args ...interface{}) {}, struct{}{}), | ||
nil, | ||
}, | ||
{ | ||
"all good no arguments passed in - variadic", | ||
NewTask(func(args ...interface{}) {}), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. could you add a test case with multiple argument types where the last one is variadic? something like NewTask(func(arg int, args ...string) {}, 1, "one", "two") There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure this was neglected in my previous commit. And it's added now in this PR. Please have a look. |
||
nil, | ||
}, | ||
} | ||
|
||
for _, tt := range tests { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 epic, i was poking around the other day but didn't notice this IsVariadic method