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
import (
"syscall"
"bytes"
"crypto/md5"
"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 {
for _, element := range haystack {
if element == needle {
@ -307,3 +309,16 @@ func TestFilenameEncryption(t *testing.T) {
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)
}
}