Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Go. Assertions for structures should be accurate #1809

Open
Assignees
Labels
ctg-bugIssue is a bug ctg-questionFurther information is requested lang-goIssue is related to Go support
@alisevych

Description

Description

Now tests generated for Go structures have assertNotEquals for the whole structure.
Actual and expected structures have only one different field.
If some other field is different in actual and expected structures, the test will pass too.

Context

for example:
utbot-go/go-samples/simple/supported_types_go_ut_test.go see TestStructWithNanByUtGoFuzzer

Actual behavior

assert.NotEqual(t, Structure{int: -1, int8: 1, int16: 32767, int32: -1, int64: -1, uint: 18446744073709551615, uint8: 0, uint16: 1, uint32: 0, uint64: 18446744073709551615, uintptr: 18446744073709551615, float32: 0.02308184, float64: math.NaN(), complex64: complex(float32(0.02308184), float32(0.02308184)), complex128: complex(0.9412491794821144, 0.9412491794821144), byte: 0, rune: -1, string: "", bool: false}, actualVal)

Expected behavior

assert.NotEqual(t, math.NaN(), actualVal.float64)

Environment

IntelliJ IDEA 2022.1 - 2022.2 Ultimate/Community
GoLand 2022.2

Metadata

Metadata

Labels

ctg-bugIssue is a bug ctg-questionFurther information is requested lang-goIssue is related to Go support

Type

No type

Projects

Status

Todo

Milestone

No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      AltStyle によって変換されたページ (->オリジナル) /