yaml 0.8.22 → 0.8.22.1
raw patch · 4 files changed
+15/−4 lines, 4 files
Files
- ChangeLog.md +5/−0
- Data/Yaml/Internal.hs +4/−3
- test/Data/YamlSpec.hs +5/−0
- yaml.cabal +1/−1
ChangeLog.md view
@@ -1,3 +1,8 @@+## 0.8.22.1++* Make numeric string detection slightly smarter so, e.g., `.` does+ not get quoted+ ## 0.8.22 * Update to libyaml hosted on Github [#105](https://github.com/snoyberg/yaml/issues/105)
Data/Yaml/Internal.hs view
@@ -284,10 +284,11 @@ "y Y yes Yes YES n N no No NO true True TRUE false False FALSE on On ON off Off OFF null Null NULL ~" isNumeric :: Text -> Bool-isNumeric =- T.all isNumeric'+isNumeric t =+ T.all isNumeric' t && T.any isNumber t where- isNumeric' c = ('0' <= c && c <= '9')+ isNumber c = '0' <= c && c <= '9'+ isNumeric' c = isNumber c || c == 'e' || c == 'E' || c == '.'
test/Data/YamlSpec.hs view
@@ -70,6 +70,7 @@ it "encode/decode strings" caseEncodeDecodeStrings it "decode invalid file" caseDecodeInvalid it "processes datatypes" caseDataTypes+ it "encode invalid numbers" caseEncodeInvalidNumbers describe "Data.Yaml.Pretty" $ do it "encode/decode" caseEncodeDecodeDataPretty it "encode/decode strings" caseEncodeDecodeStringsPretty@@ -433,6 +434,10 @@ , ("false", D.Bool False) , ("null", D.Null) ]++caseEncodeInvalidNumbers :: Assertion+caseEncodeInvalidNumbers =+ D.encode (D.String ".") @?= ".\n" caseDataTypesPretty :: Assertion caseDataTypesPretty =
yaml.cabal view
@@ -1,5 +1,5 @@ name: yaml-version: 0.8.22+version: 0.8.22.1 license: BSD3 license-file: LICENSE author: Michael Snoyman <michael@snoyman.com>, Anton Ageev <antage@gmail.com>,Kirill Simonov