From e82fa8bd57f51624e32957082e1805929f9f5d2b Mon Sep 17 00:00:00 2001 From: Denis Krivak Date: Mon, 18 May 2020 13:59:40 +0300 Subject: [PATCH] Rename test dirs. --- README.md | 4 ++-- godot_test.go | 16 ++++++++-------- testdata/checkall/{check => in}/main.go | 0 testdata/checkall/{result => out}/main.go | 0 testdata/default/{check => in}/main.go | 0 testdata/default/{result => out}/main.go | 0 6 files changed, 10 insertions(+), 10 deletions(-) rename testdata/checkall/{check => in}/main.go (100%) rename testdata/checkall/{result => out}/main.go (100%) rename testdata/default/{check => in}/main.go (100%) rename testdata/default/{result => out}/main.go (100%) diff --git a/README.md b/README.md index a47b163..864767e 100644 --- a/README.md +++ b/README.md @@ -59,5 +59,5 @@ Top level comment should end in a period: math/math.go:3:1 ``` See more examples in test files: -- [for default mode](testdata/default/check/main.go) -- [for using --all flag](testdata/checkall/check/main.go) +- [for default mode](testdata/default/in/main.go) +- [for using --all flag](testdata/checkall/in/main.go) diff --git a/godot_test.go b/godot_test.go index c5cd04d..bc7c316 100644 --- a/godot_test.go +++ b/godot_test.go @@ -338,7 +338,7 @@ func TestMakeReplacement(t *testing.T) { func TestRunIntegration(t *testing.T) { t.Run("default check", func(t *testing.T) { - var testFile = filepath.Join("testdata", "default", "check", "main.go") + var testFile = filepath.Join("testdata", "default", "in", "main.go") expected, err := readTestFile(testFile) if err != nil { t.Fatalf("Failed to read test file %s: %v", testFile, err) @@ -365,7 +365,7 @@ func TestRunIntegration(t *testing.T) { }) t.Run("check all", func(t *testing.T) { - var testFile = filepath.Join("testdata", "checkall", "check", "main.go") + var testFile = filepath.Join("testdata", "checkall", "in", "main.go") expected, err := readTestFile(testFile) if err != nil { t.Fatalf("Failed to read test file %s: %v", testFile, err) @@ -396,11 +396,11 @@ func TestRunIntegration(t *testing.T) { func TestFixIntegration(t *testing.T) { t.Run("default check", func(t *testing.T) { - var testFile = filepath.Join("testdata", "default", "check", "main.go") - var expectedFile = filepath.Join("testdata", "default", "result", "main.go") + var testFile = filepath.Join("testdata", "default", "in", "main.go") + var expectedFile = filepath.Join("testdata", "default", "out", "main.go") expected, err := ioutil.ReadFile(expectedFile) // nolint: gosec if err != nil { - t.Fatalf("Failed to read test file %s: %v", expected, err) + t.Fatalf("Failed to read test file %s: %v", expectedFile, err) } fset := token.NewFileSet() @@ -432,11 +432,11 @@ func TestFixIntegration(t *testing.T) { }) t.Run("check all", func(t *testing.T) { - var testFile = filepath.Join("testdata", "checkall", "check", "main.go") - var expectedFile = filepath.Join("testdata", "checkall", "result", "main.go") + var testFile = filepath.Join("testdata", "checkall", "in", "main.go") + var expectedFile = filepath.Join("testdata", "checkall", "out", "main.go") expected, err := ioutil.ReadFile(expectedFile) // nolint: gosec if err != nil { - t.Fatalf("Failed to read test file %s: %v", expected, err) + t.Fatalf("Failed to read test file %s: %v", expectedFile, err) } fset := token.NewFileSet() diff --git a/testdata/checkall/check/main.go b/testdata/checkall/in/main.go similarity index 100% rename from testdata/checkall/check/main.go rename to testdata/checkall/in/main.go diff --git a/testdata/checkall/result/main.go b/testdata/checkall/out/main.go similarity index 100% rename from testdata/checkall/result/main.go rename to testdata/checkall/out/main.go diff --git a/testdata/default/check/main.go b/testdata/default/in/main.go similarity index 100% rename from testdata/default/check/main.go rename to testdata/default/in/main.go diff --git a/testdata/default/result/main.go b/testdata/default/out/main.go similarity index 100% rename from testdata/default/result/main.go rename to testdata/default/out/main.go