MCPcopy
hub / github.com/bitfield/script / TestFileOutputsContentsOfSpecifiedFile

Function TestFileOutputsContentsOfSpecifiedFile

script_test.go:1268–1278  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1266}
1267
1268func 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
1280func TestFileErrorsOnNonexistentFile(t *testing.T) {
1281 t.Parallel()

Callers

nothing calls this directly

Calls 3

FileFunction · 0.92
StringMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…