Skip to content

suite: missing signature check before calling Test* method #1508

@wvell

Description

@wvell

If a test method on a suite has a parameter there is a panic:

func (suite *SomeTestSuite) TestUpdateSomething(somearg string) {
......
}

When running this you get the following panic:

suite.go:87: test panicked: reflect: Call with too few input arguments
....

I think the error handling could be more clear here. Something like "method TestUpdateSomething on SomeTestSuite contains arguments"

Here is the go.dev link: https://go.dev/play/p/cNNfqH5QpeQ

I can create a pull request if this change is wanted?

Edit: Some more context. I run into this problem when I am porting old test methods to a suite.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions