MCPcopy Index your code
hub / github.com/bitfield/script / TestIfExists_ProducesOutputAndNoErrorWhenFileExists

Function TestIfExists_ProducesOutputAndNoErrorWhenFileExists

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

Source from the content-addressed store, hash-verified

1342}
1343
1344func 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
1356func TestListFiles_OutputsDirectoryContentsGivenDirectoryPath(t *testing.T) {
1357 t.Parallel()

Callers

nothing calls this directly

Calls 4

IfExistsFunction · 0.92
StringMethod · 0.80
EchoMethod · 0.80
ErrorMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…