aboutsummaryrefslogtreecommitdiff
path: root/tests/matrix/dir_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'tests/matrix/dir_test.go')
-rw-r--r--tests/matrix/dir_test.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/matrix/dir_test.go b/tests/matrix/dir_test.go
new file mode 100644
index 0000000..e7a0b22
--- /dev/null
+++ b/tests/matrix/dir_test.go
@@ -0,0 +1,32 @@
+package matrix
+
+import (
+ "os"
+ "syscall"
+ "testing"
+
+ "github.com/rfjakob/gocryptfs/tests/test_helpers"
+)
+
+// Test Mkdir and Rmdir
+func TestMkdirRmdir(t *testing.T) {
+ test_helpers.TestMkdirRmdir(t, test_helpers.DefaultPlainDir)
+}
+
+// Overwrite an empty directory with another directory
+func TestDirOverwrite(t *testing.T) {
+ dir1 := test_helpers.DefaultPlainDir + "/DirOverwrite1"
+ dir2 := test_helpers.DefaultPlainDir + "/DirOverwrite2"
+ err := os.Mkdir(dir1, 0777)
+ if err != nil {
+ t.Fatal(err)
+ }
+ err = os.Mkdir(dir2, 0777)
+ if err != nil {
+ t.Fatal(err)
+ }
+ err = syscall.Rename(dir1, dir2)
+ if err != nil {
+ t.Fatal(err)
+ }
+}