diff --git a/internal/confmigrate/migrations_test.go b/internal/confmigrate/migrations_internal_test.go similarity index 100% rename from internal/confmigrate/migrations_test.go rename to internal/confmigrate/migrations_internal_test.go diff --git a/internal/confmigrate/migrator_test.go b/internal/confmigrate/migrator_test.go index 5cc8f3fb..27ac0592 100644 --- a/internal/confmigrate/migrator_test.go +++ b/internal/confmigrate/migrator_test.go @@ -3,7 +3,7 @@ package confmigrate_test import ( "io/fs" "os" - "path/filepath" + "path" "testing" "github.com/AdguardTeam/AdGuardHome/internal/confmigrate" @@ -12,6 +12,9 @@ import ( yaml "gopkg.in/yaml.v3" ) +// testdata is a virtual filesystem containing test data. +var testdata = os.DirFS("testdata") + // getField returns the value located at the given indexes in the given object. // It fails the test if the value is not found or of the expected type. The // indexes can be either strings or integers, and are interpreted as map keys or @@ -42,9 +45,6 @@ func getField[T any](t require.TestingT, obj any, indexes ...any) (val T) { return obj.(T) } -// testdata is a virtual filesystem containing test data. -var testdata = os.DirFS("testdata") - func TestMigrateConfig_Migrate(t *testing.T) { const ( inputFileName = "input.yml" @@ -189,10 +189,10 @@ func TestMigrateConfig_Migrate(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - body, err := fs.ReadFile(testdata, filepath.Join(t.Name(), inputFileName)) + body, err := fs.ReadFile(testdata, path.Join(t.Name(), inputFileName)) require.NoError(t, err) - wantBody, err := fs.ReadFile(testdata, filepath.Join(t.Name(), outputFileName)) + wantBody, err := fs.ReadFile(testdata, path.Join(t.Name(), outputFileName)) require.NoError(t, err) migrator := confmigrate.New(&confmigrate.Config{