Skip to content

Commit

Permalink
Update Incidents sort by Filename and Line (#244)
Browse files Browse the repository at this point in the history
Adding Line to Filename key used in Incident sorting in Analysis tests.

Signed-off-by: Marek Aufart <[email protected]>
  • Loading branch information
aufi authored Jan 10, 2025
1 parent 5260347 commit 5b10476
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions analysis/analysis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ func TestApplicationAnalysis(t *testing.T) {

} else {
// Ensure stable order of Incidents.
sort.SliceStable(got.Incidents, func(a, b int) bool { return got.Incidents[a].File < got.Incidents[b].File })
sort.SliceStable(expected.Incidents, func(a, b int) bool { return expected.Incidents[a].File < expected.Incidents[b].File })
sort.SliceStable(got.Incidents, func(a, b int) bool { return got.Incidents[a].File + fmt.Sprint(got.Incidents[a].Line) < got.Incidents[b].File + fmt.Sprint(got.Incidents[b].Line) })
sort.SliceStable(expected.Incidents, func(a, b int) bool { return expected.Incidents[a].File + fmt.Sprint(expected.Incidents[a].Line) < expected.Incidents[b].File + fmt.Sprint(expected.Incidents[b].Line)})
for j, gotInc := range got.Incidents {
expectedInc := expected.Incidents[j]
if gotInc.File != expectedInc.File {
Expand Down

0 comments on commit 5b10476

Please sign in to comment.