(t *testing.T)
| 1266 | } |
| 1267 | |
| 1268 | func TestFileOutputsContentsOfSpecifiedFile(t *testing.T) { |
| 1269 | t.Parallel() |
| 1270 | want := "This is the first line in the file.\nHello, world.\nThis is another line in the file.\n" |
| 1271 | got, err := script.File("testdata/test.txt").String() |
| 1272 | if err != nil { |
| 1273 | t.Fatal(err) |
| 1274 | } |
| 1275 | if want != got { |
| 1276 | t.Error(cmp.Diff(want, got)) |
| 1277 | } |
| 1278 | } |
| 1279 | |
| 1280 | func TestFileErrorsOnNonexistentFile(t *testing.T) { |
| 1281 | t.Parallel() |