(t *testing.T)
| 1342 | } |
| 1343 | |
| 1344 | func TestIfExists_ProducesOutputAndNoErrorWhenFileExists(t *testing.T) { |
| 1345 | t.Parallel() |
| 1346 | want := "hello" |
| 1347 | got, err := script.IfExists("testdata/empty.txt").Echo("hello").String() |
| 1348 | if err != nil { |
| 1349 | t.Fatal(err) |
| 1350 | } |
| 1351 | if want != got { |
| 1352 | t.Error(cmp.Diff(want, got)) |
| 1353 | } |
| 1354 | } |
| 1355 | |
| 1356 | func TestListFiles_OutputsDirectoryContentsGivenDirectoryPath(t *testing.T) { |
| 1357 | t.Parallel() |