blob: e7a0b224b412c360f20c224fec12ed84e3f82166 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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)
}
}
|