on master help sign in
Get rid of tags for #31
0d1136eMichael Snoyman
Data/Yaml.hs+2−1
@@ -129,7 +129,8 @@ objToEvents' (String s) rest =
129 where
129 where
130 event
130 event
131 -- Make sure that special strings are encoded as strings properly.
131 -- Make sure that special strings are encoded as strings properly.
132+ -- See: https://github.com/snoyberg/yaml/issues/31
132− | s `HashSet.member` specialStrings = EventScalar (encodeUtf8 s) StrTag SingleQuoted Nothing
133+ | s `HashSet.member` specialStrings = EventScalar (encodeUtf8 s) NoTag SingleQuoted Nothing
133 | otherwise = EventScalar (encodeUtf8 s) StrTag PlainNoTag Nothing
134 | otherwise = EventScalar (encodeUtf8 s) StrTag PlainNoTag Nothing
134objToEvents' Null rest = EventScalar "null" NullTag PlainNoTag Nothing : rest
135objToEvents' Null rest = EventScalar "null" NullTag PlainNoTag Nothing : rest
135objToEvents' (Bool True) rest = EventScalar "true" BoolTag PlainNoTag Nothing : rest
136objToEvents' (Bool True) rest = EventScalar "true" BoolTag PlainNoTag Nothing : rest
test/main.hs+1−1
@@ -121,7 +121,7 @@ main = hspec $ do
121 forM_ special $ \w -> it w $
121 forM_ special $ \w -> it w $
122 let v = object ["word" .= w]
122 let v = object ["word" .= w]
123 in D.decode (D.encode v) `shouldBe` Just v
123 in D.decode (D.encode v) `shouldBe` Just v
124−
124+ it "no tags" $ D.encode (object ["word" .= ("true" :: String)]) `shouldBe` "word: 'true'\n"
125
125
126
126
127specialStrings :: [T.Text]
127specialStrings :: [T.Text]