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:
Joey Hess 2020-11-09 20:07:31 -04:00
parent aad4129669
commit 885974be99
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
17 changed files with 211 additions and 130 deletions

View file

@ -22,6 +22,7 @@ import Types.Remote
import Types.ProposedAccepted
import Logs.UUIDBased
import Annex.SpecialRemote.Config
import Utility.QuickCheck
import qualified Data.ByteString.Lazy as L
import qualified Data.Map as M
@ -85,8 +86,10 @@ configUnEscape = unescape
rest = drop 1 r
{- for quickcheck -}
prop_isomorphic_configEscape :: String -> Bool
prop_isomorphic_configEscape s = s == (configUnEscape . configEscape) s
prop_isomorphic_configEscape :: TestableString -> Bool
prop_isomorphic_configEscape ts = s == (configUnEscape . configEscape) s
where
s = fromTestableString ts
prop_parse_show_Config :: RemoteConfig -> Bool
prop_parse_show_Config c