File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -144,6 +144,27 @@ func TestDiffWithSpacesInFilenames(t *testing.T) {
144144 assert .Equal (t , want , got )
145145}
146146
147+ func TestDiffSingleFile (t * testing.T ) {
148+ want := []string {
149+ "services/foo/serverless.yml" ,
150+ }
151+
152+ got , err := diff (`printf 'services/foo/serverless.yml'` )
153+ assert .NoError (t , err )
154+ assert .Equal (t , want , got )
155+ }
156+
157+ func TestDiffWithSpacesInFilenamesSingleFile (t * testing.T ) {
158+ want := []string {
159+ "directory/File Name With Spaces.md" ,
160+ }
161+
162+ // printf produces newline-separated output, just like git diff --name-only
163+ got , err := diff (`printf 'directory/File Name With Spaces.md'` )
164+ assert .NoError (t , err )
165+ assert .Equal (t , want , got )
166+ }
167+
147168func TestStepsToTriggerWithEmojiPaths (t * testing.T ) {
148169 watch := []WatchConfig {
149170 {
You can’t perform that action at this time.
0 commit comments