AssertFileExists 断言文件存在
(t *testing.T, path string)
| 339 | |
| 340 | // AssertFileExists 断言文件存在 |
| 341 | func 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 断言文件不存在 |
| 348 | func AssertFileNotExists(t *testing.T, path string) { |