aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/all_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-17 13:07:12 +0900
committerOphestra <cat@gensokyo.uk>2026-05-17 15:56:53 +0900
commit30eb0d6a613ad268f6805ccbcdcabf158e7f526f (patch)
tree07e55baa52748fd139e183017eeb43f5f64cee59 /internal/rosa/all_test.go
parentc2ff9c9fa55ea569a5e70ee90d2eb0b2ee2a0540 (diff)
internal/rosa: key metadata by string
For upcoming azalea integration. The API is quite ugly right now to ease migration. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/all_test.go')
-rw-r--r--internal/rosa/all_test.go81
1 files changed, 0 insertions, 81 deletions
diff --git a/internal/rosa/all_test.go b/internal/rosa/all_test.go
deleted file mode 100644
index 8f86201a..00000000
--- a/internal/rosa/all_test.go
+++ /dev/null
@@ -1,81 +0,0 @@
-package rosa_test
-
-import (
- "testing"
-
- "hakurei.app/internal/rosa"
-)
-
-func TestLoad(t *testing.T) {
- t.Parallel()
-
- for i := range rosa.PresetEnd {
- p := rosa.PArtifact(i)
- t.Run(rosa.GetMetadata(p).Name, func(t *testing.T) {
- t.Parallel()
-
- rosa.Std.Load(p)
- })
- }
-}
-
-func BenchmarkAll(b *testing.B) {
- arch, flags := rosa.Arch(), rosa.Flags()
- b.Cleanup(func() { rosa.DropCaches(arch, flags) })
-
- for b.Loop() {
- for i := range rosa.PresetEnd {
- rosa.Std.Load(rosa.PArtifact(i))
- }
-
- b.StopTimer()
- rosa.DropCaches("", 0)
- b.StartTimer()
- }
-}
-
-func TestResolveName(t *testing.T) {
- t.Parallel()
-
- for i := range rosa.PresetUnexportedStart {
- p := i
- name := rosa.GetMetadata(p).Name
- t.Run(name, func(t *testing.T) {
- t.Parallel()
-
- if got, ok := rosa.ResolveName(name); !ok {
- t.Fatal("ResolveName: ok = false")
- } else if got != p {
- t.Fatalf("ResolveName: %d, want %d", got, p)
- }
- })
- }
-}
-func TestResolveNameUnexported(t *testing.T) {
- t.Parallel()
-
- for i := rosa.PresetUnexportedStart; i < rosa.PresetEnd; i++ {
- p := i
- name := rosa.GetMetadata(p).Name
- t.Run(name, func(t *testing.T) {
- t.Parallel()
-
- if got, ok := rosa.ResolveName(name); ok {
- t.Fatalf("ResolveName: resolved unexported preset %d", got)
- }
- })
- }
-}
-
-func TestUnique(t *testing.T) {
- t.Parallel()
-
- names := make(map[string]struct{})
- for i := range rosa.PresetEnd {
- name := rosa.GetMetadata(rosa.PArtifact(i)).Name
- if _, ok := names[name]; ok {
- t.Fatalf("name %s is not unique", name)
- }
- names[name] = struct{}{}
- }
-}