Improve CopyDirRecursiveCollectFailures tests

This commit is contained in:
Julian Ospald 2016-06-14 19:32:33 +02:00
parent 5d5b0ae3c1
commit 3baecb7b51
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28

View File

@ -202,7 +202,7 @@ spec = beforeAll_ (upTmpDir >> setupFiles) $ afterAll_ cleanupFiles $
Strict Strict
CollectFailures CollectFailures
`shouldThrow` `shouldThrow`
(\(RecursiveFailure [(_, e)]) -> ioeGetErrorType e == AlreadyExists) (\(RecursiveFailure [(CreateDirFailed{}, e)]) -> ioeGetErrorType e == AlreadyExists)
it "copyDirRecursive (Strict, CollectFailures), destination already exists and is a file" $ it "copyDirRecursive (Strict, CollectFailures), destination already exists and is a file" $
copyDirRecursive' "inputDir" copyDirRecursive' "inputDir"
@ -218,7 +218,7 @@ spec = beforeAll_ (upTmpDir >> setupFiles) $ afterAll_ cleanupFiles $
Strict Strict
CollectFailures CollectFailures
`shouldThrow` `shouldThrow`
(\(RecursiveFailure [(_, e)]) -> ioeGetErrorType e == InappropriateType) (\(RecursiveFailure [(ReadContentsFailed{}, e)]) -> ioeGetErrorType e == InappropriateType)
it "copyDirRecursive (Strict, CollectFailures), wrong input (symlink to directory)" $ it "copyDirRecursive (Strict, CollectFailures), wrong input (symlink to directory)" $
copyDirRecursive' "wrongInputSymL" copyDirRecursive' "wrongInputSymL"
@ -226,7 +226,7 @@ spec = beforeAll_ (upTmpDir >> setupFiles) $ afterAll_ cleanupFiles $
Strict Strict
CollectFailures CollectFailures
`shouldThrow` `shouldThrow`
(\(RecursiveFailure [(_, e)]) -> ioeGetErrorType e == InvalidArgument) (\(RecursiveFailure [(ReadContentsFailed{}, e)]) -> ioeGetErrorType e == InvalidArgument)
it "copyDirRecursive (Strict, CollectFailures), destination in source" $ it "copyDirRecursive (Strict, CollectFailures), destination in source" $
copyDirRecursive' "inputDir" copyDirRecursive' "inputDir"