Skip to content

Commit

Permalink
fix: flaky kdl object type marshal
Browse files Browse the repository at this point in the history
  • Loading branch information
rhnvrm committed Mar 6, 2024
1 parent e2e0cc2 commit 7e7537b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions parsers/kdl/kdl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,5 +195,14 @@ null null
func sortLines(s string) string {
lines := strings.Split(s, "\n")
sort.Strings(lines)
for i, l := range lines {
if strings.HasPrefix(l, "object") {
// object a="b" c="d" should be sorted to be able to compare and
// remove flakiness.
parts := strings.Split(l, " ")
sort.Strings(parts[1:])
lines[i] = strings.Join(parts, " ")
}
}
return strings.Join(lines, "\n")
}

0 comments on commit 7e7537b

Please sign in to comment.