diff options
| author | Ophestra <cat@gensokyo.uk> | 2026-05-18 22:21:36 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2026-05-18 22:29:53 +0900 |
| commit | eb2b53307a195cfdb46187771f137eef93b8c4ba (patch) | |
| tree | a0581bee80cbabb1fee6f67002f457253dc0da74 /internal/rosa/bison_test.go | |
| parent | 682b3a2ce53252b2bd0c0da86c89c392f74f68e0 (diff) | |
internal/rosa/package: migrate gcc
The azalea implementation used an adaptation of this as testdata.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/bison_test.go')
| -rw-r--r-- | internal/rosa/bison_test.go | 35 |
1 files changed, 35 insertions, 0 deletions
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) + } + }) + } +} |
