diff --git a/internal/setup/setup_test.go b/internal/setup/setup_test.go index 18ddbce1..eeda3d50 100644 --- a/internal/setup/setup_test.go +++ b/internal/setup/setup_test.go @@ -1160,27 +1160,42 @@ var sliceKeyTests = []struct { }, { input: "fo_bar", expected: setup.SliceKey{Package: "fo", Slice: "bar"}, +}, { + input: "1234_bar", + expected: setup.SliceKey{Package: "1234", Slice: "bar"}, +}, { + input: "foo1.1-2-3_bar", + expected: setup.SliceKey{Package: "foo1.1-2-3", Slice: "bar"}, +}, { + input: "foo-pkg_dashed-slice-name", + expected: setup.SliceKey{Package: "foo-pkg", Slice: "dashed-slice-name"}, +}, { + input: "foo+_bar", + expected: setup.SliceKey{Package: "foo+", Slice: "bar"}, +}, { + input: "foo_slice123", + expected: setup.SliceKey{Package: "foo", Slice: "slice123"}, +}, { + input: "g++_bins", + expected: setup.SliceKey{Package: "g++", Slice: "bins"}, +}, { + input: "a+_bar", + expected: setup.SliceKey{Package: "a+", Slice: "bar"}, +}, { + input: "a._bar", + expected: setup.SliceKey{Package: "a.", Slice: "bar"}, }, { input: "foo_ba", err: `invalid slice reference: "foo_ba"`, }, { input: "f_bar", err: `invalid slice reference: "f_bar"`, -}, { - input: "1234_bar", - expected: setup.SliceKey{Package: "1234", Slice: "bar"}, }, { input: "1234_789", err: `invalid slice reference: "1234_789"`, -}, { - input: "foo1.1-2-3_bar", - expected: setup.SliceKey{Package: "foo1.1-2-3", Slice: "bar"}, }, { input: "chicken_bar.b.q", err: `invalid slice reference: "chicken_bar.b.q"`, -}, { - input: "foo-pkg_dashed-slice-name", - expected: setup.SliceKey{Package: "foo-pkg", Slice: "dashed-slice-name"}, }, { input: "foo-_-bar", err: `invalid slice reference: "foo-_-bar"`, @@ -1193,33 +1208,18 @@ var sliceKeyTests = []struct { }, { input: "-foo_bar", err: `invalid slice reference: "-foo_bar"`, -}, { - input: "foo+_bar", - expected: setup.SliceKey{Package: "foo+", Slice: "bar"}, -}, { - input: "foo_slice123", - expected: setup.SliceKey{Package: "foo", Slice: "slice123"}, }, { input: "foo_bar_baz", err: `invalid slice reference: "foo_bar_baz"`, -}, { - input: "g++_bins", - expected: setup.SliceKey{Package: "g++", Slice: "bins"}, -}, { - input: "a+_bar", - expected: setup.SliceKey{Package: "a+", Slice: "bar"}, }, { input: "a-_bar", err: `invalid slice reference: "a-_bar"`, -}, { - input: "a._bar", - expected: setup.SliceKey{Package: "a.", Slice: "bar"}, }, { input: "+++_bar", - err: `invalid slice reference: .*`, + err: `invalid slice reference: "\+\+\+_bar"`, }, { input: "..._bar", - err: `invalid slice reference: .*`, + err: `invalid slice reference: "\.\.\._bar"`, }, { input: "white space_no-whitespace", err: `invalid slice reference: "white space_no-whitespace"`,