fix use of hifalutin terminology
This commit is contained in:
parent
be86081ff4
commit
b0626230b7
7 changed files with 29 additions and 29 deletions
|
@ -24,5 +24,5 @@ encode :: FilePath -> String
|
||||||
encode s = "\"" ++ encode_c s ++ "\""
|
encode s = "\"" ++ encode_c s ++ "\""
|
||||||
|
|
||||||
{- for quickcheck -}
|
{- for quickcheck -}
|
||||||
prop_idempotent_deencode :: String -> Bool
|
prop_isomorphic_deencode :: String -> Bool
|
||||||
prop_idempotent_deencode s = s == decode (encode s)
|
prop_isomorphic_deencode s = s == decode (encode s)
|
||||||
|
|
|
@ -67,7 +67,7 @@ module Locations (
|
||||||
hashDirLower,
|
hashDirLower,
|
||||||
preSanitizeKeyName,
|
preSanitizeKeyName,
|
||||||
|
|
||||||
prop_idempotent_fileKey
|
prop_isomorphic_fileKey
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Data.Char
|
import Data.Char
|
||||||
|
@ -437,8 +437,8 @@ fileKey file = file2key $
|
||||||
replace "&c" ":" $ replace "%" "/" file
|
replace "&c" ":" $ replace "%" "/" file
|
||||||
|
|
||||||
{- for quickcheck -}
|
{- for quickcheck -}
|
||||||
prop_idempotent_fileKey :: String -> Bool
|
prop_isomorphic_fileKey :: String -> Bool
|
||||||
prop_idempotent_fileKey s
|
prop_isomorphic_fileKey s
|
||||||
| null s = True -- it's not legal for a key to have no keyName
|
| null s = True -- it's not legal for a key to have no keyName
|
||||||
| otherwise= Just k == fileKey (keyFile k)
|
| otherwise= Just k == fileKey (keyFile k)
|
||||||
where
|
where
|
||||||
|
|
|
@ -14,7 +14,7 @@ module Logs.Remote (
|
||||||
showConfig,
|
showConfig,
|
||||||
parseConfig,
|
parseConfig,
|
||||||
|
|
||||||
prop_idempotent_configEscape,
|
prop_isomorphic_configEscape,
|
||||||
prop_parse_show_Config,
|
prop_parse_show_Config,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
@ -84,8 +84,8 @@ configUnEscape = unescape
|
||||||
rest = drop 1 r
|
rest = drop 1 r
|
||||||
|
|
||||||
{- for quickcheck -}
|
{- for quickcheck -}
|
||||||
prop_idempotent_configEscape :: String -> Bool
|
prop_isomorphic_configEscape :: String -> Bool
|
||||||
prop_idempotent_configEscape s = s == (configUnEscape . configEscape) s
|
prop_isomorphic_configEscape s = s == (configUnEscape . configEscape) s
|
||||||
|
|
||||||
prop_parse_show_Config :: RemoteConfig -> Bool
|
prop_parse_show_Config :: RemoteConfig -> Bool
|
||||||
prop_parse_show_Config c
|
prop_parse_show_Config c
|
||||||
|
|
16
Test.hs
16
Test.hs
|
@ -131,14 +131,14 @@ tests = testGroup "Tests"
|
||||||
|
|
||||||
properties :: TestTree
|
properties :: TestTree
|
||||||
properties = localOption (QuickCheckTests 1000) $ testGroup "QuickCheck"
|
properties = localOption (QuickCheckTests 1000) $ testGroup "QuickCheck"
|
||||||
[ testProperty "prop_idempotent_deencode_git" Git.Filename.prop_idempotent_deencode
|
[ testProperty "prop_isomorphic_deencode_git" Git.Filename.prop_isomorphic_deencode
|
||||||
, testProperty "prop_idempotent_deencode" Utility.Format.prop_idempotent_deencode
|
, testProperty "prop_isomorphic_deencode" Utility.Format.prop_isomorphic_deencode
|
||||||
, testProperty "prop_idempotent_fileKey" Locations.prop_idempotent_fileKey
|
, testProperty "prop_isomorphic_fileKey" Locations.prop_isomorphic_fileKey
|
||||||
, testProperty "prop_idempotent_key_encode" Types.Key.prop_idempotent_key_encode
|
, testProperty "prop_isomorphic_key_encode" Types.Key.prop_isomorphic_key_encode
|
||||||
, testProperty "prop_idempotent_key_decode" Types.Key.prop_idempotent_key_decode
|
, testProperty "prop_isomorphic_key_decode" Types.Key.prop_isomorphic_key_decode
|
||||||
, testProperty "prop_idempotent_shellEscape" Utility.SafeCommand.prop_idempotent_shellEscape
|
, testProperty "prop_isomorphic_shellEscape" Utility.SafeCommand.prop_isomorphic_shellEscape
|
||||||
, testProperty "prop_idempotent_shellEscape_multiword" Utility.SafeCommand.prop_idempotent_shellEscape_multiword
|
, testProperty "prop_isomorphic_shellEscape_multiword" Utility.SafeCommand.prop_isomorphic_shellEscape_multiword
|
||||||
, testProperty "prop_idempotent_configEscape" Logs.Remote.prop_idempotent_configEscape
|
, testProperty "prop_isomorphic_configEscape" Logs.Remote.prop_isomorphic_configEscape
|
||||||
, testProperty "prop_parse_show_Config" Logs.Remote.prop_parse_show_Config
|
, testProperty "prop_parse_show_Config" Logs.Remote.prop_parse_show_Config
|
||||||
, testProperty "prop_upFrom_basics" Utility.Path.prop_upFrom_basics
|
, testProperty "prop_upFrom_basics" Utility.Path.prop_upFrom_basics
|
||||||
, testProperty "prop_relPathDirToFile_basics" Utility.Path.prop_relPathDirToFile_basics
|
, testProperty "prop_relPathDirToFile_basics" Utility.Path.prop_relPathDirToFile_basics
|
||||||
|
|
12
Types/Key.hs
12
Types/Key.hs
|
@ -18,8 +18,8 @@ module Types.Key (
|
||||||
isChunkKey,
|
isChunkKey,
|
||||||
isKeyPrefix,
|
isKeyPrefix,
|
||||||
|
|
||||||
prop_idempotent_key_encode,
|
prop_isomorphic_key_encode,
|
||||||
prop_idempotent_key_decode
|
prop_isomorphic_key_decode
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import System.Posix.Types
|
import System.Posix.Types
|
||||||
|
@ -135,11 +135,11 @@ instance Hashable Key where
|
||||||
hashIO32 = hashIO32 . key2file
|
hashIO32 = hashIO32 . key2file
|
||||||
hashIO64 = hashIO64 . key2file
|
hashIO64 = hashIO64 . key2file
|
||||||
|
|
||||||
prop_idempotent_key_encode :: Key -> Bool
|
prop_isomorphic_key_encode :: Key -> Bool
|
||||||
prop_idempotent_key_encode k = Just k == (file2key . key2file) k
|
prop_isomorphic_key_encode k = Just k == (file2key . key2file) k
|
||||||
|
|
||||||
prop_idempotent_key_decode :: FilePath -> Bool
|
prop_isomorphic_key_decode :: FilePath -> Bool
|
||||||
prop_idempotent_key_decode f
|
prop_isomorphic_key_decode f
|
||||||
| normalfieldorder = maybe True (\k -> key2file k == f) (file2key f)
|
| normalfieldorder = maybe True (\k -> key2file k == f) (file2key f)
|
||||||
| otherwise = True
|
| otherwise = True
|
||||||
where
|
where
|
||||||
|
|
|
@ -11,7 +11,7 @@ module Utility.Format (
|
||||||
format,
|
format,
|
||||||
decode_c,
|
decode_c,
|
||||||
encode_c,
|
encode_c,
|
||||||
prop_idempotent_deencode
|
prop_isomorphic_deencode
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Text.Printf (printf)
|
import Text.Printf (printf)
|
||||||
|
@ -174,5 +174,5 @@ encode_c' p = concatMap echar
|
||||||
showoctal i = '\\' : printf "%03o" i
|
showoctal i = '\\' : printf "%03o" i
|
||||||
|
|
||||||
{- for quickcheck -}
|
{- for quickcheck -}
|
||||||
prop_idempotent_deencode :: String -> Bool
|
prop_isomorphic_deencode :: String -> Bool
|
||||||
prop_idempotent_deencode s = s == decode_c (encode_c s)
|
prop_isomorphic_deencode s = s == decode_c (encode_c s)
|
||||||
|
|
|
@ -105,10 +105,10 @@ shellUnEscape s = word : shellUnEscape rest
|
||||||
| otherwise = inquote q (w++[c]) cs
|
| otherwise = inquote q (w++[c]) cs
|
||||||
|
|
||||||
-- | For quickcheck.
|
-- | For quickcheck.
|
||||||
prop_idempotent_shellEscape :: String -> Bool
|
prop_isomorphic_shellEscape :: String -> Bool
|
||||||
prop_idempotent_shellEscape s = [s] == (shellUnEscape . shellEscape) s
|
prop_isomorphic_shellEscape s = [s] == (shellUnEscape . shellEscape) s
|
||||||
prop_idempotent_shellEscape_multiword :: [String] -> Bool
|
prop_isomorphic_shellEscape_multiword :: [String] -> Bool
|
||||||
prop_idempotent_shellEscape_multiword s = s == (shellUnEscape . unwords . map shellEscape) s
|
prop_isomorphic_shellEscape_multiword s = s == (shellUnEscape . unwords . map shellEscape) s
|
||||||
|
|
||||||
-- | Segments a list of filenames into groups that are all below the maximum
|
-- | Segments a list of filenames into groups that are all below the maximum
|
||||||
-- command-line length limit.
|
-- command-line length limit.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue