tests: use is in a few more places
This commit is contained in:
parent
ff8d582bed
commit
51618adc37
@ -833,23 +833,23 @@ parseDateWithFormatOrDefaultFormats mformat s = firstJust $ map parsewith format
|
|||||||
-- tests
|
-- tests
|
||||||
|
|
||||||
easytests_CsvReader = tests "CsvReader" [
|
easytests_CsvReader = tests "CsvReader" [
|
||||||
tests "rulesp" [
|
tests "parseCsvRules" [
|
||||||
test "empty file" $
|
test "empty file" $
|
||||||
expectEq' (Right rules) (parseCsvRules "unknown" "")
|
parseCsvRules "unknown" "" `is` Right rules
|
||||||
|
]
|
||||||
,test "trailing comments" $
|
,tests "rulesp" [
|
||||||
expectEq' (Right rules{rdirectives = [("skip","")]}) (parseWithState' rules rulesp "skip\n# \n#\n")
|
test "trailing comments" $
|
||||||
|
parseWithState' rules rulesp "skip\n# \n#\n" `is` Right rules{rdirectives = [("skip","")]}
|
||||||
|
|
||||||
,test "trailing blank lines" $
|
,test "trailing blank lines" $
|
||||||
expectEq' (Right rules{rdirectives = [("skip","")]}) (parseWithState' rules rulesp "skip\n\n \n")
|
parseWithState' rules rulesp "skip\n\n \n" `is` (Right rules{rdirectives = [("skip","")]})
|
||||||
|
|
||||||
,test "no final newline" $
|
,test "no final newline" $
|
||||||
expectEq' (Right rules{rdirectives=[("skip","")]}) (parseWithState' rules rulesp "skip")
|
parseWithState' rules rulesp "skip" `is` (Right rules{rdirectives=[("skip","")]})
|
||||||
|
|
||||||
,test "assignment with empty value" $
|
,test "assignment with empty value" $
|
||||||
expectEq'
|
parseWithState' rules rulesp "account1 \nif foo\n account2 foo\n" `is`
|
||||||
(Right rules{rassignments = [("account1","")], rconditionalblocks = [([["foo"]],[("account2","foo")])]})
|
(Right rules{rassignments = [("account1","")], rconditionalblocks = [([["foo"]],[("account2","foo")])]})
|
||||||
(parseWithState' rules rulesp "account1 \nif foo\n account2 foo\n")
|
|
||||||
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
@ -422,12 +422,12 @@ textWidth s = maximum $ map (T.foldr (\a b -> charWidth a + b) 0) $ T.lines s
|
|||||||
|
|
||||||
easytests_Text = tests "Text" [
|
easytests_Text = tests "Text" [
|
||||||
tests "quoteIfSpaced" [
|
tests "quoteIfSpaced" [
|
||||||
expectEq' "a'a" (quoteIfSpaced "a'a")
|
quoteIfSpaced "a'a" `is` "a'a"
|
||||||
,expectEq' "a\"a" (quoteIfSpaced "a\"a")
|
,quoteIfSpaced "a\"a" `is` "a\"a"
|
||||||
,expectEq' "\"a a\"" (quoteIfSpaced "a a")
|
,quoteIfSpaced "a a" `is` "\"a a\""
|
||||||
,expectEq' "\"mimi's cafe\"" (quoteIfSpaced "mimi's cafe")
|
,quoteIfSpaced "mimi's cafe" `is` "\"mimi's cafe\""
|
||||||
,expectEq' "\"\\\"alex\\\" cafe\"" (quoteIfSpaced "\"alex\" cafe")
|
,quoteIfSpaced "\"alex\" cafe" `is` "\"\\\"alex\\\" cafe\""
|
||||||
,expectEq' "\"le'shan's cafe\"" (quoteIfSpaced "le'shan's cafe")
|
,quoteIfSpaced "le'shan's cafe" `is` "\"le'shan's cafe\""
|
||||||
,expectEq' "\"\\\"be'any's\\\" cafe\"" (quoteIfSpaced "\"be'any's\" cafe")
|
,quoteIfSpaced "\"be'any's\" cafe" `is` "\"\\\"be'any's\\\" cafe\""
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user