mirror of
https://github.com/hay-kot/homebox.git
synced 2024-11-22 08:35:43 +00:00
use ToUpper instead
This commit is contained in:
parent
d1b8b5eea2
commit
8dc3ca4db0
2 changed files with 9 additions and 3 deletions
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
|
@ -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()
|
||||||
|
|
Loading…
Reference in a new issue