test: remove unused exports

This commit is contained in:
Michael Eischer
2026-06-05 14:54:07 +02:00
parent 0bbfb072af
commit 3b8b77e54d
2 changed files with 5 additions and 8 deletions
+3 -3
View File
@@ -164,10 +164,10 @@ func isFile(fi os.FileInfo) bool {
return fi.Mode()&(os.ModeType|os.ModeCharDevice) == 0
}
// ResetReadOnly recursively resets the read-only flag recursively for dir.
// resetReadOnly recursively resets the read-only flag recursively for dir.
// This is mainly used for tests on Windows, which is unable to delete a file
// set read-only.
func ResetReadOnly(t testing.TB, dir string) {
func resetReadOnly(t testing.TB, dir string) {
t.Helper()
err := filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error {
if fi == nil {
@@ -194,7 +194,7 @@ func ResetReadOnly(t testing.TB, dir string) {
// afterwards uses os.RemoveAll() to remove the path.
func RemoveAll(t testing.TB, path string) {
t.Helper()
ResetReadOnly(t, path)
resetReadOnly(t, path)
err := os.RemoveAll(path)
if errors.Is(err, os.ErrNotExist) {
err = nil
+2 -5
View File
@@ -14,11 +14,8 @@ var (
RunIntegrationTest = getBoolVar("RESTIC_TEST_INTEGRATION", true)
RunFuseTest = getBoolVar("RESTIC_TEST_FUSE", true)
TestSFTPPath = getStringVar("RESTIC_TEST_SFTPPATH", "/usr/lib/ssh:/usr/lib/openssh:/usr/libexec")
TestWalkerPath = getStringVar("RESTIC_TEST_PATH", ".")
BenchArchiveDirectory = getStringVar("RESTIC_BENCH_DIR", ".")
TestS3Server = getStringVar("RESTIC_TEST_S3_SERVER", "")
TestRESTServer = getStringVar("RESTIC_TEST_REST_SERVER", "")
TestIntegrationDisallowSkip = getStringVar("RESTIC_TEST_DISALLOW_SKIP", "")
testIntegrationDisallowSkip = getStringVar("RESTIC_TEST_DISALLOW_SKIP", "")
)
func getStringVar(name, defaultValue string) string {
@@ -49,7 +46,7 @@ func getBoolVar(name string, defaultValue bool) bool {
// names that must be run. If name is in this list, the test is marked as
// failed.
func SkipDisallowed(t testing.TB, name string) {
for _, s := range strings.Split(TestIntegrationDisallowSkip, ",") {
for _, s := range strings.Split(testIntegrationDisallowSkip, ",") {
if s == name {
t.Fatalf("test %v is in list of tests that need to run ($RESTIC_TEST_DISALLOW_SKIP)", name)
}