yaml 0.8.1.1 → 0.8.1.2
raw patch · 3 files changed
+14/−2 lines, 3 files
Files
- Data/Yaml.hs +1/−1
- test/main.hs +12/−0
- yaml.cabal +1/−1
Data/Yaml.hs view
@@ -182,8 +182,8 @@ textToValue DoubleQuoted _ t = String t textToValue _ StrTag t = String t textToValue Folded _ t = String t-textToValue _ _ "null" = Null textToValue _ _ t+ | t `elem` ["null", "Null", "NULL", "~", ""] = Null | any (t `isLike`) ["y", "yes", "on", "true"] = Bool True | any (t `isLike`) ["n", "no", "off", "false"] = Bool False | Right (x, "") <- signed decimal t = Number $ I x
test/main.hs view
@@ -62,6 +62,12 @@ it "parses when titlecase" caseTitlecaseBool describe "empty input" $ do it "doesn't crash" caseEmptyInput+ describe "nulls" $ do+ checkNull "null"+ checkNull "Null"+ checkNull "NULL"+ checkNull "~"+ checkNull "" counter :: Monad m => (Y.Event -> Bool) -> C.Sink Y.Event m Int counter pred' =@@ -326,3 +332,9 @@ caseEmptyInput :: Assertion caseEmptyInput = D.decode B8.empty @?= (Nothing :: Maybe D.Value)++checkNull :: T.Text -> Spec+checkNull x =+ it ("null recognized: " ++ show x) assertion+ where+ assertion = Just (object [("foo", D.Null)]) @=? D.decode (B8.pack $ "foo: " ++ T.unpack x)
yaml.cabal view
@@ -1,5 +1,5 @@ name: yaml-version: 0.8.1.1+version: 0.8.1.2 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov