tests: check Mkdir and Rmdir

This commit is contained in:
Jakob Unterwurzacher 2015-11-25 22:08:07 +01:00
parent 4d466c3412
commit b5bf59a31d
1 changed files with 15 additions and 0 deletions

View File

@ -3,6 +3,7 @@ package integration_tests
// File reading, writing, modification, truncate // File reading, writing, modification, truncate
import ( import (
"syscall"
"bytes" "bytes"
"crypto/md5" "crypto/md5"
"encoding/hex" "encoding/hex"
@ -192,6 +193,7 @@ func TestFileHoles(t *testing.T) {
} }
} }
// sContains - does the slice of strings "haystack" contain "needle"?
func sContains(haystack []string, needle string) bool { func sContains(haystack []string, needle string) bool {
for _, element := range haystack { for _, element := range haystack {
if element == needle { if element == needle {
@ -307,3 +309,16 @@ func TestFilenameEncryption(t *testing.T) {
t.Errorf("file name encryption not working") t.Errorf("file name encryption not working")
} }
} }
// Test Mkdir and Rmdir
func TestMkdirRmdir(t *testing.T) {
dir := defaultPlainDir + "dir1"
err := os.Mkdir(dir, 0777)
if err != nil {
t.Fatal(err)
}
err = syscall.Rmdir(dir)
if err != nil {
t.Fatal(err)
}
}