on master help sign in
Get rid of tags for #31
commit0d1136e5a79dedb317a0cadb071073d00213a429 authorMichael Snoyman <michael@snoyman.com> dateMon 7 Oct 2013, 18:59 (13 years ago) parent2d71dd2
2 files changed+3−2
Data/Yaml.hs+2−1 test/main.hs+1−1
Data/Yaml.hs+2−1
@@ -129,7 +129,8 @@ objToEvents' (String s) rest =
129129 where
130130 event
131131 -- Make sure that special strings are encoded as strings properly.
132− | s `HashSet.member` specialStrings = EventScalar (encodeUtf8 s) StrTag SingleQuoted Nothing
132+ -- See: https://github.com/snoyberg/yaml/issues/31
133+ | s `HashSet.member` specialStrings = EventScalar (encodeUtf8 s) NoTag SingleQuoted Nothing
133134 | otherwise = EventScalar (encodeUtf8 s) StrTag PlainNoTag Nothing
134135objToEvents' Null rest = EventScalar "null" NullTag PlainNoTag Nothing : rest
135136objToEvents' (Bool True) rest = EventScalar "true" BoolTag PlainNoTag Nothing : rest
test/main.hs+1−1
@@ -121,7 +121,7 @@ main = hspec $ do
121121 forM_ special $ \w -> it w $
122122 let v = object ["word" .= w]
123123 in D.decode (D.encode v) `shouldBe` Just v
124−
124+ it "no tags" $ D.encode (object ["word" .= ("true" :: String)]) `shouldBe` "word: 'true'\n"
125125
126126
127127specialStrings :: [T.Text]