From ce1383dc1110859cbd94dcb3762ce6df246048ec Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 2 May 2016 19:08:46 +0200 Subject: [PATCH] TESTS: first set of hspec tests --- hsfm.cabal | 16 + test/Spec.hs | 459 ++++++++++++++++++ test/copyDirRecursiveSpec/alreadyExists | 0 .../copyDirRecursiveSpec/alreadyExistsD/.keep | 0 .../inputDir/bar/inputFile3 | 8 + .../inputDir/foo/inputFile1 | 1 + test/copyDirRecursiveSpec/inputDir/inputFile2 | 4 + test/copyDirRecursiveSpec/noWritePerm/.keep | 0 test/copyDirRecursiveSpec/wrongInput | 0 test/copyDirRecursiveSpec/wrongInputSymL | 1 + test/copyFileSpec/alreadyExists | 0 test/copyFileSpec/alreadyExistsD/.keep | 0 test/copyFileSpec/inputFile | 2 + test/copyFileSpec/inputFileSymL | 1 + test/copyFileSpec/outputDirNoWrite/.keep | 0 test/copyFileSpec/wrongInput/.keep | 0 test/createDirSpec/.keep | 0 test/createDirSpec/alreadyExists/.keep | 0 test/createDirSpec/noWritePerms/.keep | 0 test/createRegularFileSpec/alreadyExists | 0 test/createRegularFileSpec/noWritePerms/.keep | 0 test/moveFile/alreadyExists | 2 + test/moveFile/alreadyExistsD/.keep | 0 test/moveFile/dir/.keep | 0 test/moveFile/myFile | 4 + test/moveFile/myFileL | 1 + test/moveFile/noWritePerm/.keep | 0 test/recreateSymlinkSpec/alreadyExists | 3 + test/recreateSymlinkSpec/alreadyExistsD/.keep | 0 test/recreateSymlinkSpec/dir/.keep | 0 test/recreateSymlinkSpec/myFile | 4 + test/recreateSymlinkSpec/myFileL | 1 + test/recreateSymlinkSpec/noWritePerm/.keep | 0 test/renameFile/alreadyExists | 3 + test/renameFile/alreadyExistsD/.keep | 0 test/renameFile/dir/.keep | 0 test/renameFile/myFile | 4 + test/renameFile/myFileL | 1 + test/renameFile/noWritePerm/.keep | 0 39 files changed, 515 insertions(+) create mode 100644 test/Spec.hs create mode 100644 test/copyDirRecursiveSpec/alreadyExists create mode 100644 test/copyDirRecursiveSpec/alreadyExistsD/.keep create mode 100644 test/copyDirRecursiveSpec/inputDir/bar/inputFile3 create mode 100644 test/copyDirRecursiveSpec/inputDir/foo/inputFile1 create mode 100644 test/copyDirRecursiveSpec/inputDir/inputFile2 create mode 100644 test/copyDirRecursiveSpec/noWritePerm/.keep create mode 100644 test/copyDirRecursiveSpec/wrongInput create mode 120000 test/copyDirRecursiveSpec/wrongInputSymL create mode 100644 test/copyFileSpec/alreadyExists create mode 100644 test/copyFileSpec/alreadyExistsD/.keep create mode 100644 test/copyFileSpec/inputFile create mode 120000 test/copyFileSpec/inputFileSymL create mode 100644 test/copyFileSpec/outputDirNoWrite/.keep create mode 100644 test/copyFileSpec/wrongInput/.keep create mode 100644 test/createDirSpec/.keep create mode 100644 test/createDirSpec/alreadyExists/.keep create mode 100644 test/createDirSpec/noWritePerms/.keep create mode 100644 test/createRegularFileSpec/alreadyExists create mode 100644 test/createRegularFileSpec/noWritePerms/.keep create mode 100644 test/moveFile/alreadyExists create mode 100644 test/moveFile/alreadyExistsD/.keep create mode 100644 test/moveFile/dir/.keep create mode 100644 test/moveFile/myFile create mode 120000 test/moveFile/myFileL create mode 100644 test/moveFile/noWritePerm/.keep create mode 100644 test/recreateSymlinkSpec/alreadyExists create mode 100644 test/recreateSymlinkSpec/alreadyExistsD/.keep create mode 100644 test/recreateSymlinkSpec/dir/.keep create mode 100644 test/recreateSymlinkSpec/myFile create mode 120000 test/recreateSymlinkSpec/myFileL create mode 100644 test/recreateSymlinkSpec/noWritePerm/.keep create mode 100644 test/renameFile/alreadyExists create mode 100644 test/renameFile/alreadyExistsD/.keep create mode 100644 test/renameFile/dir/.keep create mode 100644 test/renameFile/myFile create mode 120000 test/renameFile/myFileL create mode 100644 test/renameFile/noWritePerm/.keep diff --git a/hsfm.cabal b/hsfm.cabal index 565f58e..a9d0a27 100644 --- a/hsfm.cabal +++ b/hsfm.cabal @@ -111,3 +111,19 @@ executable hsfm-gtk -threaded -Wall "-with-rtsopts=-N" + + +Test-Suite spec + Type: exitcode-stdio-1.0 + Default-Language: Haskell2010 + Hs-Source-Dirs: test + Main-Is: Spec.hs + GHC-Options: -Wall + Build-Depends: base + , HUnit + , bytestring + , hpath + , hsfm + , hspec >= 1.3 + , process + , unix diff --git a/test/Spec.hs b/test/Spec.hs new file mode 100644 index 0000000..b520c42 --- /dev/null +++ b/test/Spec.hs @@ -0,0 +1,459 @@ +{-# LANGUAGE OverloadedStrings #-} + +import Test.Hspec +import HSFM.FileSystem.FileOperations +import Data.Maybe + ( + fromJust + ) +import qualified HPath as P +import System.Posix.Env.ByteString + ( + getEnv + ) +import HSFM.FileSystem.Errors +import HSFM.Utils.IO +import System.IO.Error + ( + ioeGetErrorType + ) +import GHC.IO.Exception + ( + IOErrorType(..) + ) +import Data.ByteString + ( + ByteString + ) +import System.Exit +import System.Process + + + +-- TODO: chardev, blockdev, namedpipe, socket +-- TODO: no permission to open input file/dir + + +main :: IO () +main = hspec $ do + copyFileSpec + copyDirRecursiveSpec + createDirSpec + createRegularFileSpec + renameFileSpec + moveFileSpec + recreateSymlinkSpec + -- TODO: deleteFile, deleteDir, deleteDirRecursive, getDirsFiles, getFileType + + + + ------------- + --[ Specs ]-- + ------------- + + +copyFileSpec :: Spec +copyFileSpec = + describe "HSFM.FileSystem.FileOperations.copyFile" $ do + + -- successes -- + it "copyFile, everything clear" $ + copyFile' "test/copyFileSpec/inputFile" + "test/copyFileSpec/outputFile" + + -- posix failures -- + it "copyFile, and compare" $ + copyFile'' "test/copyFileSpec/inputFile" + "test/copyFileSpec/outputFile" + (system $ "cmp -s " ++ "test/copyFileSpec/inputFile" ++ " " + ++ "test/copyFileSpec/outputFile") + `shouldReturn` ExitSuccess + + it "copyFile, input file does not exist" $ + copyFile' "test/copyFileSpec/noSuchFile" + "test/copyFileSpec/outputFile" + `shouldThrow` + (\e -> ioeGetErrorType e == NoSuchThing) + + it "copyFile, no permission to write to output directory" $ + copyFile' "test/copyFileSpec/inputFile" + "test/copyFileSpec/outputDirNoWrite/outputFile" + `shouldThrow` + (\e -> ioeGetErrorType e == PermissionDenied) + + it "copyFile, wrong input type (symlink)" $ + copyFile' "test/copyFileSpec/inputFileSymL" + "test/copyFileSpec/outputFile" + `shouldThrow` + (\e -> ioeGetErrorType e == InvalidArgument) + + it "copyFile, wrong input type (directory)" $ + copyFile' "test/copyFileSpec/wrongInput" + "test/copyFileSpec/outputFile" + `shouldThrow` + (\e -> ioeGetErrorType e == InappropriateType) + + it "copyFile, output and input are same file" $ + copyFile' "test/copyFileSpec/inputFile" + "test/copyFileSpec/inputFile" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + it "copyFile, output file already exists" $ + copyFile' "test/copyFileSpec/inputFile" + "test/copyFileSpec/alreadyExists" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + it "copyFile, output file already exists and is a dir" $ + copyFile' "test/copyFileSpec/inputFile" + "test/copyFileSpec/alreadyExistsD" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + +copyDirRecursiveSpec :: Spec +copyDirRecursiveSpec = + describe "HSFM.FileSystem.FileOperations.copyDirRecursive" $ do + + -- successes -- + it "copyDirRecursive, all fine" $ + copyDirRecursive' "test/copyDirRecursiveSpec/inputDir" + "test/copyDirRecursiveSpec/outputDir" + + it "copyDirRecursive, all fine and compare" $ + copyDirRecursive'' "test/copyDirRecursiveSpec/inputDir" + "test/copyDirRecursiveSpec/outputDir" + (system $ "diff -r --no-dereference " + ++ "test/copyDirRecursiveSpec/inputDir" ++ " " + ++ "test/copyDirRecursiveSpec/outputDir") + `shouldReturn` ExitSuccess + + -- posix failures -- + it "copyDirRecursive, source directory does not exist" $ + copyDirRecursive' "test/copyDirRecursiveSpec/doesNotExist" + "test/copyDirRecursiveSpec/outputDir" + `shouldThrow` + (\e -> ioeGetErrorType e == NoSuchThing) + + it "copyDirRecursive, no write permission on destination dir" $ + copyDirRecursive' "test/copyDirRecursiveSpec/inputDir" + "test/copyDirRecursiveSpec/noWritePerm/foo" + `shouldThrow` + (\e -> ioeGetErrorType e == PermissionDenied) + + it "copyDirRecursive, destination dir already exists" $ + copyDirRecursive' "test/copyDirRecursiveSpec/inputDir" + "test/copyDirRecursiveSpec/alreadyExistsD" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + it "copyDirRecursive, destination already exists and is a file" $ + copyDirRecursive' "test/copyDirRecursiveSpec/inputDir" + "test/copyDirRecursiveSpec/alreadyExists" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + it "copyDirRecursive, destination and source same file" $ + copyDirRecursive' "test/copyDirRecursiveSpec/inputDir" + "test/copyDirRecursiveSpec/inputDir" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + it "copyDirRecursive, destination in source" $ + copyDirRecursive' "test/copyDirRecursiveSpec/inputDir" + "test/copyDirRecursiveSpec/inputDir/foo" + `shouldThrow` + isDestinationInSource + + it "copyDirRecursive, wrong input (regular file)" $ + copyDirRecursive' "test/copyDirRecursiveSpec/wrongInput" + "test/copyDirRecursiveSpec/outputDir" + `shouldThrow` + (\e -> ioeGetErrorType e == InappropriateType) + + it "copyDirRecursive, wrong input (symlink to directory)" $ + copyDirRecursive' "test/copyDirRecursiveSpec/wrongInputSymL" + "test/copyDirRecursiveSpec/outputDir" + `shouldThrow` + (\e -> ioeGetErrorType e == InvalidArgument) + + +createDirSpec :: Spec +createDirSpec = + describe "HSFM.FileSystem.FileOperations.createDir" $ do + + -- successes -- + it "createDir, all fine" $ + createDir' "test/createDirSpec/newDir" + + -- posix failures -- + it "createDir, can't write to destination directory" $ + createDir' "test/createDirSpec/noWritePerms/newDir" + `shouldThrow` + (\e -> ioeGetErrorType e == PermissionDenied) + + it "createDir, destination directory already exists" $ + createDir' "test/createDirSpec/alreadyExists" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + +createRegularFileSpec :: Spec +createRegularFileSpec = + describe "HSFM.FileSystem.FileOperations.createRegularFile" $ do + + -- successes -- + it "createRegularFile, all fine" $ + createRegularFile' "test/createRegularFileSpec/newDir" + + -- posix failures -- + it "createRegularFile, can't write to destination directory" $ + createRegularFile' "test/createRegularFileSpec/noWritePerms/newDir" + `shouldThrow` + (\e -> ioeGetErrorType e == PermissionDenied) + + it "createRegularFile, destination file already exists" $ + createRegularFile' "test/createRegularFileSpec/alreadyExists" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + +renameFileSpec :: Spec +renameFileSpec = + describe "HSFM.FileSystem.FileOperations.renameFile" $ do + + -- successes -- + it "renameFile, all fine" $ + renameFile' "test/renameFile/myFile" + "test/renameFile/renamedFile" + + it "renameFile, all fine" $ + renameFile' "test/renameFile/myFile" + "test/renameFile/dir/renamedFile" + + it "renameFile, all fine on symlink" $ + renameFile' "test/renameFile/myFileL" + "test/renameFile/renamedFile" + + it "renameFile, all fine on directory" $ + renameFile' "test/renameFile/dir" + "test/renameFile/renamedFile" + + -- posix failures -- + it "renameFile, source file does not exist" $ + renameFile' "test/renameFile/fileDoesNotExist" + "test/renameFile/renamedFile" + `shouldThrow` + (\e -> ioeGetErrorType e == NoSuchThing) + + it "renameFile, can't write to destination directory" $ + renameFile' "test/renameFile/myFile" + "test/renameFile/noWritePerm/renamedFile" + `shouldThrow` + (\e -> ioeGetErrorType e == PermissionDenied) + + -- custom failures -- + it "renameFile, destination file already exists" $ + renameFile' "test/renameFile/myFile" + "test/renameFile/alreadyExists" + `shouldThrow` + isFileDoesExist + + it "renameFile, move from file to dir" $ + renameFile' "test/renameFile/myFile" + "test/renameFile/alreadyExistsD" + `shouldThrow` + isDirDoesExist + + it "renameFile, source and dest are same file" $ + renameFile' "test/renameFile/myFile" + "test/renameFile/myFile" + `shouldThrow` + isSameFile + + +moveFileSpec :: Spec +moveFileSpec = + describe "HSFM.FileSystem.FileOperations.moveFile" $ do + + -- successes -- + it "moveFile, all fine" $ + moveFile' "test/moveFile/myFile" + "test/moveFile/movedFile" + + it "moveFile, all fine" $ + moveFile' "test/moveFile/myFile" + "test/moveFile/dir/movedFile" + + it "moveFile, all fine on symlink" $ + moveFile' "test/moveFile/myFileL" + "test/moveFile/movedFile" + + it "moveFile, all fine on directory" $ + moveFile' "test/moveFile/dir" + "test/moveFile/movedFile" + + -- posix failures -- + it "moveFile, source file does not exist" $ + moveFile' "test/moveFile/fileDoesNotExist" + "test/moveFile/movedFile" + `shouldThrow` + (\e -> ioeGetErrorType e == NoSuchThing) + + it "moveFile, can't write to destination directory" $ + moveFile' "test/moveFile/myFile" + "test/moveFile/noWritePerm/movedFile" + `shouldThrow` + (\e -> ioeGetErrorType e == PermissionDenied) + + -- custom failures -- + it "moveFile, destination file already exists" $ + moveFile' "test/moveFile/myFile" + "test/moveFile/alreadyExists" + `shouldThrow` + isFileDoesExist + + it "moveFile, move from file to dir" $ + moveFile' "test/moveFile/myFile" + "test/moveFile/alreadyExistsD" + `shouldThrow` + isDirDoesExist + + it "moveFile, source and dest are same file" $ + moveFile' "test/moveFile/myFile" + "test/moveFile/myFile" + `shouldThrow` + isSameFile + + +recreateSymlinkSpec :: Spec +recreateSymlinkSpec = + describe "HSFM.FileSystem.FileOperations.recreateSymlink" $ do + + -- successes -- + it "recreateSymLink, all fine" $ + recreateSymlink' "test/recreateSymlinkSpec/myFileL" + "test/recreateSymlinkSpec/movedFile" + + it "recreateSymLink, all fine" $ + recreateSymlink' "test/recreateSymlinkSpec/myFileL" + "test/recreateSymlinkSpec/dir/movedFile" + + -- posix failures -- + it "recreateSymLink, wrong input type (file)" $ + recreateSymlink' "test/recreateSymlinkSpec/myFile" + "test/recreateSymlinkSpec/movedFile" + `shouldThrow` + (\e -> ioeGetErrorType e == InvalidArgument) + + it "recreateSymLink, wrong input type (directory)" $ + recreateSymlink' "test/recreateSymlinkSpec/dir" + "test/recreateSymlinkSpec/movedFile" + `shouldThrow` + (\e -> ioeGetErrorType e == InvalidArgument) + + it "recreateSymLink, can't write to destination directory" $ + recreateSymlink' "test/recreateSymlinkSpec/myFileL" + "test/recreateSymlinkSpec/noWritePerm/movedFile" + `shouldThrow` + (\e -> ioeGetErrorType e == PermissionDenied) + + it "recreateSymLink, destination file already exists" $ + recreateSymlink' "test/recreateSymlinkSpec/myFileL" + "test/recreateSymlinkSpec/alreadyExists" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + it "recreateSymLink, destination already exists and is a dir" $ + recreateSymlink' "test/recreateSymlinkSpec/myFileL" + "test/recreateSymlinkSpec/alreadyExistsD" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + it "recreateSymLink, source and destination are the same file" $ + recreateSymlink' "test/recreateSymlinkSpec/myFileL" + "test/recreateSymlinkSpec/myFileL" + `shouldThrow` + (\e -> ioeGetErrorType e == AlreadyExists) + + + + ----------------- + --[ Utilities ]-- + ----------------- + + +copyFile'' :: ByteString -> ByteString -> IO a -> IO a +copyFile'' inputFileP outputFileP before_cleanup = do + pwd <- fromJust <$> getEnv "PWD" >>= P.parseAbs + inputFile <- (pwd P.) <$> P.parseRel inputFileP + outputFile <- (pwd P.) <$> P.parseRel outputFileP + copyFile inputFile outputFile + r <- before_cleanup + whenM (doesFileExist outputFile) (deleteFile outputFile) + return r + + +copyFile' :: ByteString -> ByteString -> IO () +copyFile' inputFileP outputFileP = + copyFile'' inputFileP outputFileP (return ()) + + +copyDirRecursive'' :: ByteString -> ByteString -> IO a -> IO a +copyDirRecursive'' inputDirP outputDirP before_cleanup = do + pwd <- fromJust <$> getEnv "PWD" >>= P.parseAbs + inputDir <- (pwd P.) <$> P.parseRel inputDirP + outputDir <- (pwd P.) <$> P.parseRel outputDirP + copyDirRecursive inputDir outputDir + r <- before_cleanup + whenM (doesDirectoryExist outputDir) (deleteDirRecursive outputDir) + return r + + +copyDirRecursive' :: ByteString -> ByteString -> IO () +copyDirRecursive' inputDirP outputDirP = + copyDirRecursive'' inputDirP outputDirP (return ()) + + +createDir' :: ByteString -> IO () +createDir' dest = do + pwd <- fromJust <$> getEnv "PWD" >>= P.parseAbs + outputDir <- (pwd P.) <$> P.parseRel dest + createDir outputDir + whenM (doesDirectoryExist outputDir) (deleteDir outputDir) + + +createRegularFile' :: ByteString -> IO () +createRegularFile' dest = do + pwd <- fromJust <$> getEnv "PWD" >>= P.parseAbs + outputFile <- (pwd P.) <$> P.parseRel dest + createRegularFile outputFile + whenM (doesFileExist outputFile) (deleteFile outputFile) + + +renameFile' :: ByteString -> ByteString -> IO () +renameFile' inputFileP outputFileP = do + pwd <- fromJust <$> getEnv "PWD" >>= P.parseAbs + inputFile <- (pwd P.) <$> P.parseRel inputFileP + outputFile <- (pwd P.) <$> P.parseRel outputFileP + renameFile inputFile outputFile + renameFile outputFile inputFile + + +moveFile' :: ByteString -> ByteString -> IO () +moveFile' inputFileP outputFileP = do + pwd <- fromJust <$> getEnv "PWD" >>= P.parseAbs + inputFile <- (pwd P.) <$> P.parseRel inputFileP + outputFile <- (pwd P.) <$> P.parseRel outputFileP + moveFile inputFile outputFile + moveFile outputFile inputFile + + +recreateSymlink' :: ByteString -> ByteString -> IO () +recreateSymlink' inputFileP outputFileP = do + pwd <- fromJust <$> getEnv "PWD" >>= P.parseAbs + inputFile <- (pwd P.) <$> P.parseRel inputFileP + outputFile <- (pwd P.) <$> P.parseRel outputFileP + recreateSymlink inputFile outputFile + whenM (doesFileExist outputFile) (deleteFile outputFile) diff --git a/test/copyDirRecursiveSpec/alreadyExists b/test/copyDirRecursiveSpec/alreadyExists new file mode 100644 index 0000000..e69de29 diff --git a/test/copyDirRecursiveSpec/alreadyExistsD/.keep b/test/copyDirRecursiveSpec/alreadyExistsD/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/copyDirRecursiveSpec/inputDir/bar/inputFile3 b/test/copyDirRecursiveSpec/inputDir/bar/inputFile3 new file mode 100644 index 0000000..8b2f378 --- /dev/null +++ b/test/copyDirRecursiveSpec/inputDir/bar/inputFile3 @@ -0,0 +1,8 @@ +dadasasddas +sda + +!!1 +sda + + +11 diff --git a/test/copyDirRecursiveSpec/inputDir/foo/inputFile1 b/test/copyDirRecursiveSpec/inputDir/foo/inputFile1 new file mode 100644 index 0000000..31c5074 --- /dev/null +++ b/test/copyDirRecursiveSpec/inputDir/foo/inputFile1 @@ -0,0 +1 @@ +dadasasddas diff --git a/test/copyDirRecursiveSpec/inputDir/inputFile2 b/test/copyDirRecursiveSpec/inputDir/inputFile2 new file mode 100644 index 0000000..1eed72f --- /dev/null +++ b/test/copyDirRecursiveSpec/inputDir/inputFile2 @@ -0,0 +1,4 @@ +dadasasddas +das +sda +sda diff --git a/test/copyDirRecursiveSpec/noWritePerm/.keep b/test/copyDirRecursiveSpec/noWritePerm/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/copyDirRecursiveSpec/wrongInput b/test/copyDirRecursiveSpec/wrongInput new file mode 100644 index 0000000..e69de29 diff --git a/test/copyDirRecursiveSpec/wrongInputSymL b/test/copyDirRecursiveSpec/wrongInputSymL new file mode 120000 index 0000000..e722311 --- /dev/null +++ b/test/copyDirRecursiveSpec/wrongInputSymL @@ -0,0 +1 @@ +inputDir/ \ No newline at end of file diff --git a/test/copyFileSpec/alreadyExists b/test/copyFileSpec/alreadyExists new file mode 100644 index 0000000..e69de29 diff --git a/test/copyFileSpec/alreadyExistsD/.keep b/test/copyFileSpec/alreadyExistsD/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/copyFileSpec/inputFile b/test/copyFileSpec/inputFile new file mode 100644 index 0000000..5f5521f --- /dev/null +++ b/test/copyFileSpec/inputFile @@ -0,0 +1,2 @@ +abc +def diff --git a/test/copyFileSpec/inputFileSymL b/test/copyFileSpec/inputFileSymL new file mode 120000 index 0000000..55529d2 --- /dev/null +++ b/test/copyFileSpec/inputFileSymL @@ -0,0 +1 @@ +inputFile \ No newline at end of file diff --git a/test/copyFileSpec/outputDirNoWrite/.keep b/test/copyFileSpec/outputDirNoWrite/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/copyFileSpec/wrongInput/.keep b/test/copyFileSpec/wrongInput/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/createDirSpec/.keep b/test/createDirSpec/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/createDirSpec/alreadyExists/.keep b/test/createDirSpec/alreadyExists/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/createDirSpec/noWritePerms/.keep b/test/createDirSpec/noWritePerms/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/createRegularFileSpec/alreadyExists b/test/createRegularFileSpec/alreadyExists new file mode 100644 index 0000000..e69de29 diff --git a/test/createRegularFileSpec/noWritePerms/.keep b/test/createRegularFileSpec/noWritePerms/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/moveFile/alreadyExists b/test/moveFile/alreadyExists new file mode 100644 index 0000000..82a6fbd --- /dev/null +++ b/test/moveFile/alreadyExists @@ -0,0 +1,2 @@ +dasklaksd +sda diff --git a/test/moveFile/alreadyExistsD/.keep b/test/moveFile/alreadyExistsD/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/moveFile/dir/.keep b/test/moveFile/dir/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/moveFile/myFile b/test/moveFile/myFile new file mode 100644 index 0000000..1f62e72 --- /dev/null +++ b/test/moveFile/myFile @@ -0,0 +1,4 @@ +asd +sda + +sda diff --git a/test/moveFile/myFileL b/test/moveFile/myFileL new file mode 120000 index 0000000..c97626f --- /dev/null +++ b/test/moveFile/myFileL @@ -0,0 +1 @@ +myFile \ No newline at end of file diff --git a/test/moveFile/noWritePerm/.keep b/test/moveFile/noWritePerm/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/recreateSymlinkSpec/alreadyExists b/test/recreateSymlinkSpec/alreadyExists new file mode 100644 index 0000000..f9c6694 --- /dev/null +++ b/test/recreateSymlinkSpec/alreadyExists @@ -0,0 +1,3 @@ +asdl +dsa +sd diff --git a/test/recreateSymlinkSpec/alreadyExistsD/.keep b/test/recreateSymlinkSpec/alreadyExistsD/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/recreateSymlinkSpec/dir/.keep b/test/recreateSymlinkSpec/dir/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/recreateSymlinkSpec/myFile b/test/recreateSymlinkSpec/myFile new file mode 100644 index 0000000..ee838ea --- /dev/null +++ b/test/recreateSymlinkSpec/myFile @@ -0,0 +1,4 @@ +ads +sad +das +sda diff --git a/test/recreateSymlinkSpec/myFileL b/test/recreateSymlinkSpec/myFileL new file mode 120000 index 0000000..c97626f --- /dev/null +++ b/test/recreateSymlinkSpec/myFileL @@ -0,0 +1 @@ +myFile \ No newline at end of file diff --git a/test/recreateSymlinkSpec/noWritePerm/.keep b/test/recreateSymlinkSpec/noWritePerm/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/renameFile/alreadyExists b/test/renameFile/alreadyExists new file mode 100644 index 0000000..f9c6694 --- /dev/null +++ b/test/renameFile/alreadyExists @@ -0,0 +1,3 @@ +asdl +dsa +sd diff --git a/test/renameFile/alreadyExistsD/.keep b/test/renameFile/alreadyExistsD/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/renameFile/dir/.keep b/test/renameFile/dir/.keep new file mode 100644 index 0000000..e69de29 diff --git a/test/renameFile/myFile b/test/renameFile/myFile new file mode 100644 index 0000000..ee838ea --- /dev/null +++ b/test/renameFile/myFile @@ -0,0 +1,4 @@ +ads +sad +das +sda diff --git a/test/renameFile/myFileL b/test/renameFile/myFileL new file mode 120000 index 0000000..c97626f --- /dev/null +++ b/test/renameFile/myFileL @@ -0,0 +1 @@ +myFile \ No newline at end of file diff --git a/test/renameFile/noWritePerm/.keep b/test/renameFile/noWritePerm/.keep new file mode 100644 index 0000000..e69de29