aboutsummaryrefslogtreecommitdiff
path: root/utils/fileutils_test.go
diff options
context:
space:
mode:
authorn-peugnet <n.peugnet@free.fr>2021-09-09 18:55:06 +0200
committern-peugnet <n.peugnet@free.fr>2021-09-09 18:55:06 +0200
commitbea4f87f1e4528630d326699a9c7fd6133ee7806 (patch)
tree49bff8fed5e9e1a7d4546ad41454e6ee07f6fa25 /utils/fileutils_test.go
parent3e866db2accc6ed5aa65befdf21474dbc7b1ec18 (diff)
downloaddna-backup-bea4f87f1e4528630d326699a9c7fd6133ee7806.tar.gz
dna-backup-bea4f87f1e4528630d326699a9c7fd6133ee7806.zip
better commit and restore tests (almost complete)
added some file path management function for prfixes and trailing slash
Diffstat (limited to 'utils/fileutils_test.go')
-rw-r--r--utils/fileutils_test.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/utils/fileutils_test.go b/utils/fileutils_test.go
new file mode 100644
index 0000000..176d856
--- /dev/null
+++ b/utils/fileutils_test.go
@@ -0,0 +1,15 @@
+package utils
+
+import (
+ "path/filepath"
+ "testing"
+)
+
+func TestTrimTrailingSeparator(t *testing.T) {
+ if TrimTrailingSeparator("test"+string(filepath.Separator)) != "test" {
+ t.Error("Seprator should have been trimmed")
+ }
+ if TrimTrailingSeparator("test") != "test" {
+ t.Error("Path should not have changed")
+ }
+}