(t *testing.T)
| 1330 | } |
| 1331 | |
| 1332 | func TestIfExists_ProducesErrorPlusNoOutputForNonexistentFile(t *testing.T) { |
| 1333 | t.Parallel() |
| 1334 | want := "" |
| 1335 | got, err := script.IfExists("testdata/doesntexist").Echo("hello").String() |
| 1336 | if err == nil { |
| 1337 | t.Fatal("want error") |
| 1338 | } |
| 1339 | if want != got { |
| 1340 | t.Error(cmp.Diff(want, got)) |
| 1341 | } |
| 1342 | } |
| 1343 | |
| 1344 | func TestIfExists_ProducesOutputAndNoErrorWhenFileExists(t *testing.T) { |
| 1345 | t.Parallel() |