-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
ctg-bugIssue is a bugIssue is a buglang-goIssue is related to Go supportIssue is related to Go support
Description
Description
Incorrect generation of tests for functions that have no parameter name or an blank name.
To Reproduce
Steps to reproduce the behavior:
- Write the following functions:
func foo(_ int) {
}
func bar(int) {
}- Use plugin to generate tests
Expected behavior
Similar to this file should be generated.
package simple
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestFooByUtGoFuzzer(t *testing.T) {
arg := 0
assert.NotPanics(t, func() {
foo(arg)
})
}
func TestBarByUtGoFuzzer(t *testing.T) {
arg := 0
assert.NotPanics(t, func() {
bar(arg)
})
}Actual behavior
package simple
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestFooByUtGoFuzzer(t *testing.T) {
_ := 0
assert.NotPanics(t, func() {
foo(_)
})
}
func TestBarByUtGoFuzzer(t *testing.T) {
:= 0
assert.NotPanics(t, func() {
bar()
})
}Environment
There is no specific environment.
Metadata
Metadata
Assignees
Labels
ctg-bugIssue is a bugIssue is a buglang-goIssue is related to Go supportIssue is related to Go support
Type
Projects
Status
Done