Skip to content

Commit f179a77

Browse files
committed
Sort the results before testing for equality
Signed-off-by: Remy Suen <[email protected]>
1 parent ab5d382 commit f179a77

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/compose/inlayHint_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"fmt"
55
"os"
66
"path/filepath"
7+
"slices"
78
"strings"
89
"testing"
910

@@ -205,6 +206,9 @@ services:
205206
t.Run(tc.name, func(t *testing.T) {
206207
doc := document.NewComposeDocument(u, 1, []byte(tc.content))
207208
inlayHints, err := InlayHint(doc, protocol.Range{})
209+
slices.SortFunc(inlayHints, func(a protocol.InlayHint, b protocol.InlayHint) int {
210+
return int(a.Position.Line) - int(b.Position.Line)
211+
})
208212
require.NoError(t, err)
209213
require.Equal(t, tc.inlayHints, inlayHints)
210214
})

0 commit comments

Comments
 (0)