t_common_test.go: added function fileExists()
This commit is contained in:
@@ -6,6 +6,7 @@ package expr
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"path"
|
||||
"runtime"
|
||||
"strings"
|
||||
@@ -176,3 +177,10 @@ func testIteratorCallOp(t *testing.T, section string, it kern.Iterator) {
|
||||
t.Errorf(`%s -- CallOperation("fake") should return error`, section)
|
||||
}
|
||||
}
|
||||
|
||||
// Test utilities
|
||||
|
||||
func fileExists(filePath string) bool {
|
||||
_, err := os.Stat(filePath)
|
||||
return !errors.Is(err, os.ErrNotExist)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user