Description
Tests are not generated if there are types in the function body that are not among the parameters, result parameters of the function and the following list of imports: "io", "context", "encoding/json", "errors", "fmt", "log", "math", "net", "reflect", "strconv", "strings", "testing", "time", "unsafe".
To Reproduce
Steps to reproduce the behavior:
- Write the following function:
import "math/cmplx"
func Abs(n complex128) float64 {
return cmplx.Abs(n)
}
- Use plugin to generate tests
Expected behavior
Similar to this file should be generated.
import (
"github.com/stretchr/testify/assert"
"testing"
)
func TestAbsByUtGoFuzzer(t *testing.T) {
actualVal := Abs(complex(1.0, 1.0))
assert.Equal(t, 1.4142135623730951, actualVal)
}
Actual behavior
Empty file is generated.
Visual proofs (screenshots, logs, images)
| UtBot - GoTestCasesGenerator | Fuzzing for function [Abs] - started
| UtBot - GoTestCasesGenerator | Error in flow: Timeout exceeded: Worker not connected. Process output: # simple [simple.test]
.\utbot_go_worker_samples_test.go:637:9: undefined: cmplx
FAIL simple [build failed]
| UtBot - GoTestCasesGenerator | Fuzzing for function [Abs] - completed in 10027 ms. Generated 0 test cases
Environment
There is no specific environment.
Additional context
There is no additional context.
Description
Tests are not generated if there are types in the function body that are not among the parameters, result parameters of the function and the following list of imports:
"io","context","encoding/json","errors","fmt","log","math","net","reflect","strconv","strings","testing","time","unsafe".To Reproduce
Steps to reproduce the behavior:
Expected behavior
Similar to this file should be generated.
Actual behavior
Empty file is generated.
Visual proofs (screenshots, logs, images)
Environment
There is no specific environment.
Additional context
There is no additional context.