Skip to content

No support for import aliases #1777

Description

@egiptipavel

Description

Tests are not generated if there are import aliases.

To Reproduce

Steps to reproduce the behavior:

  1. Write the following function:
import c "math/cmplx"

func Abs(n complex128) float64 {
	return c.Abs(n)
}
  1. 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: c
FAIL	simple [build failed]

| UtBot - GoTestCasesGenerator      | Fuzzing for function [Abs] - completed in 10014 ms. Generated 0 test cases

Environment

There is no specific environment.

Additional context

There is no specific environment.

Metadata

Metadata

Assignees

Labels

ctg-bugIssue is a buglang-goIssue is related to Go support

Type

No type

Fields

No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions