Skip to content

Commit

Permalink
Add a unit test for the sort ordering change. (#1444)
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Moore <[email protected]>
  • Loading branch information
mattmoor authored Dec 17, 2024
1 parent 00e43dd commit 672e5b1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pkg/build/lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,29 @@ func TestUnify(t *testing.T) {
"amd64": {"intel-fast-as-f-math"},
"arm64": {"arm-energy-efficient-as-f-arithmetic"},
},
}, {
name: "sorting with dashes",
originals: []string{"foo", "foo-bar"},
inputs: []resolved{{
arch: "amd64",
packages: sets.New("foo", "foo-bar"),
versions: map[string]string{
"foo": "1.2.3",
"foo-bar": "2.4.6",
},
}},
want: map[string][]string{
"amd64": {
// This comes first because '-' sorts before '='.
"foo-bar=2.4.6",
"foo=1.2.3",
},
"index": {
// This comes first because '-' sorts before '='.
"foo-bar=2.4.6",
"foo=1.2.3",
},
},
}}

for _, test := range tests {
Expand Down

0 comments on commit 672e5b1

Please sign in to comment.