From b5bf59a31d78527171d6d6109b51e8dee7f024c8 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Wed, 25 Nov 2015 22:08:07 +0100 Subject: [PATCH] tests: check Mkdir and Rmdir --- integration_tests/main_test.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/integration_tests/main_test.go b/integration_tests/main_test.go index c38bc11..4b2c11e 100644 --- a/integration_tests/main_test.go +++ b/integration_tests/main_test.go @@ -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) + } +}