MCPcopy Create free account
hub / github.com/astercloud/aster / AssertFileExists

Function AssertFileExists

pkg/tools/builtin/testutils.go:341–345  ·  view source on GitHub ↗

AssertFileExists 断言文件存在

(t *testing.T, path string)

Source from the content-addressed store, hash-verified

339
340// AssertFileExists 断言文件存在
341func AssertFileExists(t *testing.T, path string) {
342 if _, err := os.Stat(path); os.IsNotExist(err) {
343 t.Errorf("Expected file %q to exist, but it doesn't", path)
344 }
345}
346
347// AssertFileNotExists 断言文件不存在
348func AssertFileNotExists(t *testing.T, path string) {

Callers 2

Calls 1

StatMethod · 0.65

Tested by 2