Skip to content

Commit ecb2773

Browse files
committed
tests: rename files
1 parent f8600b9 commit ecb2773

File tree

16 files changed

+26
-26
lines changed

16 files changed

+26
-26
lines changed

gomoddirectives_test.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestAnalyze(t *testing.T) {
1717
_ = os.Chdir(wd)
1818
}()
1919

20-
err = os.Chdir("./testdata/a/")
20+
err = os.Chdir("./testdata/replace/")
2121
require.NoError(t, err)
2222

2323
results, err := Analyze(Options{})
@@ -35,13 +35,13 @@ func TestAnalyzeFile(t *testing.T) {
3535
}{
3636
{
3737
desc: "replace: allow nothing",
38-
modulePath: "a/go.mod",
38+
modulePath: "replace/go.mod",
3939
opts: Options{},
4040
expected: 2,
4141
},
4242
{
43-
desc: "replace: allow a replace",
44-
modulePath: "a/go.mod",
43+
desc: "replace: allow an element",
44+
modulePath: "replace/go.mod",
4545
opts: Options{
4646
ReplaceAllowList: []string{
4747
"github.com/gorilla/mux",
@@ -51,15 +51,15 @@ func TestAnalyzeFile(t *testing.T) {
5151
},
5252
{
5353
desc: "replace: allow local",
54-
modulePath: "a/go.mod",
54+
modulePath: "replace/go.mod",
5555
opts: Options{
5656
ReplaceAllowLocal: true,
5757
},
5858
expected: 1,
5959
},
6060
{
6161
desc: "replace: exclude all",
62-
modulePath: "a/go.mod",
62+
modulePath: "replace/go.mod",
6363
opts: Options{
6464
ReplaceAllowLocal: true,
6565
ReplaceAllowList: []string{
@@ -71,7 +71,7 @@ func TestAnalyzeFile(t *testing.T) {
7171
},
7272
{
7373
desc: "replace: allow list doesn't override allow local",
74-
modulePath: "a/go.mod",
74+
modulePath: "replace/go.mod",
7575
opts: Options{
7676
ReplaceAllowLocal: false,
7777
ReplaceAllowList: []string{
@@ -82,7 +82,7 @@ func TestAnalyzeFile(t *testing.T) {
8282
},
8383
{
8484
desc: "replace: duplicate replacement",
85-
modulePath: "e/go.mod",
85+
modulePath: "replace_duplicate/go.mod",
8686
opts: Options{
8787
ReplaceAllowLocal: true,
8888
ReplaceAllowList: []string{
@@ -93,8 +93,8 @@ func TestAnalyzeFile(t *testing.T) {
9393
expected: 2,
9494
},
9595
{
96-
desc: "replace: replaced by the same",
97-
modulePath: "f/go.mod",
96+
desc: "replace: replaced with identical element",
97+
modulePath: "replace_identical/go.mod",
9898
opts: Options{
9999
ReplaceAllowLocal: true,
100100
ReplaceAllowList: []string{
@@ -106,7 +106,7 @@ func TestAnalyzeFile(t *testing.T) {
106106
},
107107
{
108108
desc: "replace: duplicate replacement but for the different versions",
109-
modulePath: "g/go.mod",
109+
modulePath: "replace_duplicate_versions/go.mod",
110110
opts: Options{
111111
ReplaceAllowLocal: true,
112112
ReplaceAllowList: []string{
@@ -118,31 +118,31 @@ func TestAnalyzeFile(t *testing.T) {
118118
},
119119
{
120120
desc: "retract: allow no explanation",
121-
modulePath: "c/go.mod",
121+
modulePath: "retract/go.mod",
122122
opts: Options{
123123
RetractAllowNoExplanation: true,
124124
},
125125
expected: 0,
126126
},
127127
{
128128
desc: "retract: explanation is require",
129-
modulePath: "c/go.mod",
129+
modulePath: "retract/go.mod",
130130
opts: Options{
131131
RetractAllowNoExplanation: false,
132132
},
133133
expected: 1,
134134
},
135135
{
136136
desc: "exclude: don't allow",
137-
modulePath: "d/go.mod",
137+
modulePath: "exclude/go.mod",
138138
opts: Options{
139139
ExcludeForbidden: true,
140140
},
141141
expected: 2,
142142
},
143143
{
144144
desc: "exclude: allow",
145-
modulePath: "d/go.mod",
145+
modulePath: "exclude/go.mod",
146146
opts: Options{
147147
ExcludeForbidden: false,
148148
},

module_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ func TestGetModuleFile(t *testing.T) {
1515
_ = os.Chdir(wd)
1616
}()
1717

18-
err = os.Chdir("./testdata/a/")
18+
err = os.Chdir("./testdata/replace/")
1919
require.NoError(t, err)
2020

2121
file, err := GetModuleFile()
2222
require.NoError(t, err)
2323

24-
assert.Equal(t, "github.com/ldez/gomoddirectives/testdata/a", file.Module.Mod.Path)
24+
assert.Equal(t, "github.com/ldez/gomoddirectives/testdata/replace", file.Module.Mod.Path)
2525
}
2626

2727
func TestGetModuleFile_here(t *testing.T) {

testdata/b/go.mod

Lines changed: 0 additions & 3 deletions
This file was deleted.

testdata/empty/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/ldez/gomoddirectives/testdata/empty
2+
3+
go 1.16

testdata/d/go.mod renamed to testdata/exclude/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ldez/gomoddirectives/testdata/d
1+
module github.com/ldez/gomoddirectives/testdata/exclude
22

33
go 1.16
44

File renamed without changes.

testdata/a/go.mod renamed to testdata/replace/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ldez/gomoddirectives/testdata/a
1+
module github.com/ldez/gomoddirectives/testdata/replace
22

33
go 1.16
44

File renamed without changes.

testdata/e/go.mod renamed to testdata/replace_duplicate/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ldez/gomoddirectives/testdata/e
1+
module github.com/ldez/gomoddirectives/testdata/replace_duplicate_versions
22

33
go 1.16
44

File renamed without changes.

testdata/g/go.mod renamed to testdata/replace_duplicate_versions/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ldez/gomoddirectives/testdata/g
1+
module github.com/ldez/gomoddirectives/testdata/replace_duplicate_versions
22

33
go 1.16
44

File renamed without changes.

testdata/f/go.mod renamed to testdata/replace_identical/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ldez/gomoddirectives/testdata/f
1+
module github.com/ldez/gomoddirectives/testdata/replace_identical
22

33
go 1.16
44

File renamed without changes.

testdata/c/go.mod renamed to testdata/retract/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ldez/gomoddirectives/testdata/c
1+
module github.com/ldez/gomoddirectives/testdata/retract
22

33
go 1.16
44

File renamed without changes.

0 commit comments

Comments
 (0)