diff --git a/Makefile b/Makefile index 1ec45fa7..7635d742 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ COMMIT := $(shell git log | head -n 1 | awk '{print substr($$2, 0, 12)}') NOW := $(shell date +"%FT%T%z") # ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) -TESTFOLDER := $(shell $(GO) list ./... | grep -E 'api|model|flow|script' | grep -vE 'examples|tests*|config|widgets') +TESTFOLDER := $(shell $(GO) list ./... | grep -E 'api|model|flow|script|fs|i18n' | grep -vE 'examples|tests*|config|widgets') TESTTAGS ?= "" # TESTWIDGETS := $(shell $(GO) list ./widgets/...) diff --git a/i18n/i18n.go b/i18n/i18n.go index c38ed4b2..b4e437e5 100644 --- a/i18n/i18n.go +++ b/i18n/i18n.go @@ -3,7 +3,6 @@ package i18n import ( "crypto/sha256" "fmt" - "path/filepath" "strings" "sync" "time" @@ -45,8 +44,7 @@ func Load(cfg config.Config) error { } // Load langs - root := filepath.Join(cfg.Root, "langs") - err = lang.Load(root) + err = lang.Load("langs") if err != nil { return err } diff --git a/i18n/i18n_test.go b/i18n/i18n_test.go index 1bd16398..0cfb30b1 100644 --- a/i18n/i18n_test.go +++ b/i18n/i18n_test.go @@ -6,11 +6,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/yaoapp/gou/lang" "github.com/yaoapp/yao/config" - "github.com/yaoapp/yao/share" + "github.com/yaoapp/yao/test" ) func TestLoad(t *testing.T) { - share.DBConnect(config.Conf.DB) + test.Prepare(t, config.Conf) + defer test.Clean() + err := Load(config.Conf) if err != nil { t.Fatal(err)