Skip to content

Commit 0df7073

Browse files
committed
fix: fix tests to enforce one line changed file during diff
1 parent 39aefb6 commit 0df7073

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

pipeline_test.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,7 @@ func TestDiff(t *testing.T) {
9999
"README.md",
100100
}
101101

102-
got, err := diff(`echo services/foo/serverless.yml
103-
services/bar/config.yml
104-
105-
ops/bar/config.yml
106-
README.md`)
102+
got, err := diff(`printf 'services/foo/serverless.yml\nservices/bar/config.yml\n\nops/bar/config.yml\nREADME.md\n'`)
107103

108104
assert.NoError(t, err)
109105
assert.Equal(t, want, got)
@@ -114,7 +110,7 @@ func TestDiffWithSubshell(t *testing.T) {
114110
"user-service/infrastructure/cloudfront.yaml",
115111
"user-service/serverless.yaml",
116112
}
117-
got, err := diff("echo $(cat e2e/multiple-paths)")
113+
got, err := diff("cat e2e/multiple-paths")
118114
assert.NoError(t, err)
119115
assert.Equal(t, want, got)
120116
}
@@ -124,7 +120,7 @@ func TestDiffWithQuotedPaths(t *testing.T) {
124120
"projects/test/pages/17_🪁_testfile.py",
125121
"normal/file.txt",
126122
}
127-
got, err := diff(`printf '"projects/test/pages/17_\360\237\252\201_testfile.py" normal/file.txt'`)
123+
got, err := diff(`printf '"projects/test/pages/17_\360\237\252\201_testfile.py"\nnormal/file.txt'`)
128124
assert.NoError(t, err)
129125
assert.Equal(t, want, got)
130126
}

0 commit comments

Comments
 (0)