aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/builtins_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-21 23:06:34 +0900
committerOphestra <cat@gensokyo.uk>2026-05-21 23:06:34 +0900
commit68a91523b9e58ee8a9f86723d616e82c0645b64a (patch)
treea16f116b6b606d50bd2e887a173b981552ca0eb0 /internal/rosa/builtins_test.go
parent564732162223e76a307bb06e132e9f0351f239bf (diff)
internal/rosa/package: migrate bison
This is the final remaining trivial legacy artifact. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/builtins_test.go')
-rw-r--r--internal/rosa/builtins_test.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/internal/rosa/builtins_test.go b/internal/rosa/builtins_test.go
new file mode 100644
index 00000000..e18ba461
--- /dev/null
+++ b/internal/rosa/builtins_test.go
@@ -0,0 +1,35 @@
+package rosa
+
+import (
+ "slices"
+ "strconv"
+ "strings"
+ "testing"
+)
+
+func TestSkipGNUTests(t *testing.T) {
+ t.Parallel()
+
+ testCases := []struct {
+ tests []int64
+ want string
+ }{
+ {[]int64{764}, "1-763 765-"},
+ {[]int64{764, 0xcafe, 37, 9}, "1-8 10-36 38-763 765-51965 51967-"},
+ {[]int64{1, 2, 0xbed}, "3-3052 3054-"},
+ {[]int64{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(int(n)))
+ }
+ }), ","), func(t *testing.T) {
+ t.Parallel()
+
+ if got := skipGNUTests(tc.tests...); got != tc.want {
+ t.Errorf("skipGNUTests: %q, want %q", got, tc.want)
+ }
+ })
+ }
+}