From eb2b53307a195cfdb46187771f137eef93b8c4ba Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 18 May 2026 22:21:36 +0900 Subject: internal/rosa/package: migrate gcc The azalea implementation used an adaptation of this as testdata. Signed-off-by: Ophestra --- internal/rosa/bison_test.go | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 internal/rosa/bison_test.go (limited to 'internal/rosa/bison_test.go') diff --git a/internal/rosa/bison_test.go b/internal/rosa/bison_test.go new file mode 100644 index 00000000..94d82618 --- /dev/null +++ b/internal/rosa/bison_test.go @@ -0,0 +1,35 @@ +package rosa + +import ( + "slices" + "strconv" + "strings" + "testing" +) + +func TestSkipGNUTests(t *testing.T) { + t.Parallel() + + testCases := []struct { + tests []int + want string + }{ + {[]int{764}, "1-763 765-"}, + {[]int{764, 0xcafe, 37, 9}, "1-8 10-36 38-763 765-51965 51967-"}, + {[]int{1, 2, 0xbed}, "3-3052 3054-"}, + {[]int{3, 4}, "1-2 5-"}, + } + for _, tc := range testCases { + t.Run(strings.Join(slices.Collect(func(yield func(string) bool) { + for _, n := range tc.tests { + yield(strconv.Itoa(n)) + } + }), ","), func(t *testing.T) { + t.Parallel() + + if got := skipGNUTests(tc.tests...); got != tc.want { + t.Errorf("skipGNUTests: %q, want %q", got, tc.want) + } + }) + } +} -- cgit v1.3.1