MCPcopy
hub / github.com/stretchr/testify / FileExists

Function FileExists

require/require.go:586–594  ·  view source on GitHub ↗

FileExists checks whether a file exists in the given path. It also fails if the path points to a directory or there is an error when trying to check the file.

(t TestingT, path string, msgAndArgs ...interface{})

Source from the content-addressed store, hash-verified

584// FileExists checks whether a file exists in the given path. It also fails if
585// the path points to a directory or there is an error when trying to check the file.
586func FileExists(t TestingT, path string, msgAndArgs ...interface{}) {
587 if h, ok := t.(tHelper); ok {
588 h.Helper()
589 }
590 if assert.FileExists(t, path, msgAndArgs...) {
591 return
592 }
593 t.FailNow()
594}
595
596// FileExistsf checks whether a file exists in the given path. It also fails if
597// the path points to a directory or there is an error when trying to check the file.

Callers 1

FileExistsMethod · 0.70

Calls 3

FileExistsFunction · 0.92
HelperMethod · 0.65
FailNowMethod · 0.65

Tested by

no test coverage detected