encode s = "\"" ++ encode_c s ++ "\""
{- for quickcheck -}
-prop_idempotent_deencode :: String -> Bool
-prop_idempotent_deencode s = s == decode (encode s)
+prop_isomorphic_deencode :: String -> Bool
+prop_isomorphic_deencode s = s == decode (encode s)
hashDirLower,
preSanitizeKeyName,
- prop_idempotent_fileKey
+ prop_isomorphic_fileKey
) where
import Data.Char
replace "&c" ":" $ replace "%" "/" file
{- for quickcheck -}
-prop_idempotent_fileKey :: String -> Bool
-prop_idempotent_fileKey s
+prop_isomorphic_fileKey :: String -> Bool
+prop_isomorphic_fileKey s
| null s = True -- it's not legal for a key to have no keyName
| otherwise= Just k == fileKey (keyFile k)
where
showConfig,
parseConfig,
- prop_idempotent_configEscape,
+ prop_isomorphic_configEscape,
prop_parse_show_Config,
) where
rest = drop 1 r
{- for quickcheck -}
-prop_idempotent_configEscape :: String -> Bool
-prop_idempotent_configEscape s = s == (configUnEscape . configEscape) s
+prop_isomorphic_configEscape :: String -> Bool
+prop_isomorphic_configEscape s = s == (configUnEscape . configEscape) s
prop_parse_show_Config :: RemoteConfig -> Bool
prop_parse_show_Config c
properties :: TestTree
properties = localOption (QuickCheckTests 1000) $ testGroup "QuickCheck"
- [ testProperty "prop_idempotent_deencode_git" Git.Filename.prop_idempotent_deencode
- , testProperty "prop_idempotent_deencode" Utility.Format.prop_idempotent_deencode
- , testProperty "prop_idempotent_fileKey" Locations.prop_idempotent_fileKey
- , testProperty "prop_idempotent_key_encode" Types.Key.prop_idempotent_key_encode
- , testProperty "prop_idempotent_key_decode" Types.Key.prop_idempotent_key_decode
- , testProperty "prop_idempotent_shellEscape" Utility.SafeCommand.prop_idempotent_shellEscape
- , testProperty "prop_idempotent_shellEscape_multiword" Utility.SafeCommand.prop_idempotent_shellEscape_multiword
- , testProperty "prop_idempotent_configEscape" Logs.Remote.prop_idempotent_configEscape
+ [ testProperty "prop_isomorphic_deencode_git" Git.Filename.prop_isomorphic_deencode
+ , testProperty "prop_isomorphic_deencode" Utility.Format.prop_isomorphic_deencode
+ , testProperty "prop_isomorphic_fileKey" Locations.prop_isomorphic_fileKey
+ , testProperty "prop_isomorphic_key_encode" Types.Key.prop_isomorphic_key_encode
+ , testProperty "prop_isomorphic_key_decode" Types.Key.prop_isomorphic_key_decode
+ , testProperty "prop_isomorphic_shellEscape" Utility.SafeCommand.prop_isomorphic_shellEscape
+ , testProperty "prop_isomorphic_shellEscape_multiword" Utility.SafeCommand.prop_isomorphic_shellEscape_multiword
+ , testProperty "prop_isomorphic_configEscape" Logs.Remote.prop_isomorphic_configEscape
, testProperty "prop_parse_show_Config" Logs.Remote.prop_parse_show_Config
, testProperty "prop_upFrom_basics" Utility.Path.prop_upFrom_basics
, testProperty "prop_relPathDirToFile_basics" Utility.Path.prop_relPathDirToFile_basics
isChunkKey,
isKeyPrefix,
- prop_idempotent_key_encode,
- prop_idempotent_key_decode
+ prop_isomorphic_key_encode,
+ prop_isomorphic_key_decode
) where
import System.Posix.Types
hashIO32 = hashIO32 . key2file
hashIO64 = hashIO64 . key2file
-prop_idempotent_key_encode :: Key -> Bool
-prop_idempotent_key_encode k = Just k == (file2key . key2file) k
+prop_isomorphic_key_encode :: Key -> Bool
+prop_isomorphic_key_encode k = Just k == (file2key . key2file) k
-prop_idempotent_key_decode :: FilePath -> Bool
-prop_idempotent_key_decode f
+prop_isomorphic_key_decode :: FilePath -> Bool
+prop_isomorphic_key_decode f
| normalfieldorder = maybe True (\k -> key2file k == f) (file2key f)
| otherwise = True
where
format,
decode_c,
encode_c,
- prop_idempotent_deencode
+ prop_isomorphic_deencode
) where
import Text.Printf (printf)
showoctal i = '\\' : printf "%03o" i
{- for quickcheck -}
-prop_idempotent_deencode :: String -> Bool
-prop_idempotent_deencode s = s == decode_c (encode_c s)
+prop_isomorphic_deencode :: String -> Bool
+prop_isomorphic_deencode s = s == decode_c (encode_c s)
| otherwise = inquote q (w++[c]) cs
-- | For quickcheck.
-prop_idempotent_shellEscape :: String -> Bool
-prop_idempotent_shellEscape s = [s] == (shellUnEscape . shellEscape) s
-prop_idempotent_shellEscape_multiword :: [String] -> Bool
-prop_idempotent_shellEscape_multiword s = s == (shellUnEscape . unwords . map shellEscape) s
+prop_isomorphic_shellEscape :: String -> Bool
+prop_isomorphic_shellEscape s = [s] == (shellUnEscape . shellEscape) s
+prop_isomorphic_shellEscape_multiword :: [String] -> Bool
+prop_isomorphic_shellEscape_multiword s = s == (shellUnEscape . unwords . map shellEscape) s
-- | Segments a list of filenames into groups that are all below the maximum
-- command-line length limit.