add newtypes for QuickCheck to avoid LANG=C issues
All properties changed to use them, except for prop_encode_c_decode_c_roundtrip, which already filtered to ascii for other reasons. A few modules had to be split out, because Setup does not build-depend on QuickCheck.
This commit is contained in:
parent
aad4129669
commit
885974be99
17 changed files with 211 additions and 130 deletions
|
@ -17,6 +17,7 @@ module Annex.View.ViewedFile (
|
|||
) where
|
||||
|
||||
import Annex.Common
|
||||
import Utility.QuickCheck
|
||||
|
||||
import qualified Data.ByteString as S
|
||||
|
||||
|
@ -78,11 +79,12 @@ dirFromViewedFile = joinPath . drop 1 . sep [] ""
|
|||
[] -> sep l curr cs
|
||||
| otherwise = sep l (c:curr) cs
|
||||
|
||||
prop_viewedFile_roundtrips :: FilePath -> Bool
|
||||
prop_viewedFile_roundtrips f
|
||||
prop_viewedFile_roundtrips :: TestableFilePath -> Bool
|
||||
prop_viewedFile_roundtrips tf
|
||||
-- Relative filenames wanted, not directories.
|
||||
| any (isPathSeparator) (end f ++ beginning f) = True
|
||||
| isAbsolute f = True
|
||||
| otherwise = dir == dirFromViewedFile (viewedFileFromReference f)
|
||||
where
|
||||
f = fromTestableFilePath tf
|
||||
dir = joinPath $ beginning $ splitDirectories f
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue