use ToUpper instead

This commit is contained in:
Hayden 2024-01-05 14:16:32 -06:00
parent d1b8b5eea2
commit 8dc3ca4db0
No known key found for this signature in database
GPG key ID: 17CF79474E257545
2 changed files with 9 additions and 3 deletions

View file

@ -90,10 +90,10 @@ func (cs *CurrencyRegistry) Slice() []Currency {
} }
func (cs *CurrencyRegistry) IsSupported(code string) bool { func (cs *CurrencyRegistry) IsSupported(code string) bool {
lower := strings.ToLower(code) upper := strings.ToUpper(code)
cs.mu.RLock() cs.mu.RLock()
defer cs.mu.RUnlock() defer cs.mu.RUnlock()
_, ok := cs.registry[lower] _, ok := cs.registry[upper]
return ok return ok
} }

View file

@ -6,6 +6,7 @@ import (
"os" "os"
"testing" "testing"
"github.com/hay-kot/homebox/backend/internal/core/currencies"
"github.com/hay-kot/homebox/backend/internal/core/services/reporting/eventbus" "github.com/hay-kot/homebox/backend/internal/core/services/reporting/eventbus"
"github.com/hay-kot/homebox/backend/internal/data/ent" "github.com/hay-kot/homebox/backend/internal/data/ent"
"github.com/hay-kot/homebox/backend/internal/data/repo" "github.com/hay-kot/homebox/backend/internal/data/repo"
@ -61,7 +62,12 @@ func TestMain(m *testing.M) {
tClient = client tClient = client
tRepos = repo.New(tClient, tbus, os.TempDir()+"/homebox") tRepos = repo.New(tClient, tbus, os.TempDir()+"/homebox")
tSvc = New(tRepos)
defaults, _ := currencies.CollectionCurrencies(
currencies.CollectDefaults(),
)
tSvc = New(tRepos, WithCurrencies(defaults))
defer func() { _ = client.Close() }() defer func() { _ = client.Close() }()
bootstrap() bootstrap()