diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-06-26 12:15:27 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-06-26 12:15:55 -0400 |
commit | 63f9aba33b45e5bab688ffaa5e4182801c152828 (patch) | |
tree | 1f4e16640503b27bbd0f33241cbe1cb2c4a4eb89 /Git/Filename.hs | |
parent | c799b05deae723690bfac5e867f7985e8f800d0d (diff) | |
download | git-repair-63f9aba33b45e5bab688ffaa5e4182801c152828.tar.gz |
merge from git-annex
Removes dependency on MissingH, adding a dependency on split instead.
This commit was sponsored by Brock Spratlen on Patreon.
Diffstat (limited to 'Git/Filename.hs')
-rw-r--r-- | Git/Filename.hs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Git/Filename.hs b/Git/Filename.hs index ee84d48..355e75f 100644 --- a/Git/Filename.hs +++ b/Git/Filename.hs @@ -8,9 +8,10 @@ module Git.Filename where +import Common import Utility.Format (decode_c, encode_c) -import Common +import Data.Char decode :: String -> FilePath decode [] = [] @@ -23,6 +24,11 @@ decode f@(c:s) encode :: FilePath -> String encode s = "\"" ++ encode_c s ++ "\"" -{- for quickcheck -} -prop_isomorphic_deencode :: String -> Bool -prop_isomorphic_deencode s = s == decode (encode s) +{- For quickcheck. + - + - See comment on Utility.Format.prop_encode_c_decode_c_roundtrip for + - why this only tests chars < 256 -} +prop_encode_decode_roundtrip :: String -> Bool +prop_encode_decode_roundtrip s = s' == decode (encode s') + where + s' = filter (\c -> ord c < 256) s |