summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Remote.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/Logs/Remote.hs b/Logs/Remote.hs
index 3348059b4..55fb40f4b 100644
--- a/Logs/Remote.hs
+++ b/Logs/Remote.hs
@@ -11,8 +11,11 @@ module Logs.Remote (
configSet,
keyValToConfig,
configToKeyVal,
+ showConfig,
+ parseConfig,
- prop_idempotent_configEscape
+ prop_idempotent_configEscape,
+ prop_parse_show_Config,
) where
import qualified Data.Map as M
@@ -86,3 +89,12 @@ configUnEscape = unescape
{- for quickcheck -}
prop_idempotent_configEscape :: String -> Bool
prop_idempotent_configEscape s = s == (configUnEscape . configEscape) s
+
+prop_parse_show_Config :: RemoteConfig -> Bool
+prop_parse_show_Config c
+ -- whitespace and '=' are not supported in keys
+ | any (\k -> any isSpace k || any (== '=') k) (M.keys c) = True
+ | otherwise = parseConfig (showConfig c) ~~ Just c
+ where
+ normalize v = sort . M.toList <$> v
+ a ~~ b = normalize a == normalize b