Escape non-source characters in the encoder

This commit is contained in:
2019-12-19 06:59:27 +01:00
parent 0cbe69736b
commit 9a5d54c035
3 changed files with 16 additions and 7 deletions

View File

@ -17,3 +17,5 @@ spec = describe "value" $ do
value minified (String "\\") `shouldBe` "\"\\\\\""
it "escapes quotes" $
value minified (String "\"") `shouldBe` "\"\\\"\""
it "escapes backspace" $
value minified (String "a\bc") `shouldBe` "\"a\\bc\""