summaryrefslogtreecommitdiff
path: root/libraries/base/tests
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2016-07-17 00:12:52 +0200
committerBen Gamari <ben@smart-cactus.org>2016-07-17 00:12:53 +0200
commit0f0cdb6827803015a9a3924fdafaef8dbcde048f (patch)
treec35159a2c5ba6b4c9d9bfe4aa759c1878fa06813 /libraries/base/tests
parent24f5f368d8ed0b5f113c2753b2b2bdc99957dcb2 (diff)
downloadhaskell-0f0cdb6827803015a9a3924fdafaef8dbcde048f.tar.gz
Bugfix for bug 11632: `readLitChar` should consume null characters
Test Plan: The tests have been included. This change deals with a relatively minor edge case and should not break unrelated functionality. Reviewers: thomie, #core_libraries_committee, ekmett, bgamari Reviewed By: #core_libraries_committee, ekmett, bgamari Subscribers: bgamari, ekmett Differential Revision: https://phabricator.haskell.org/D2391 GHC Trac Issues: #11632
Diffstat (limited to 'libraries/base/tests')
-rw-r--r--libraries/base/tests/readLitChar.hs5
-rw-r--r--libraries/base/tests/readLitChar.stdout4
2 files changed, 8 insertions, 1 deletions
diff --git a/libraries/base/tests/readLitChar.hs b/libraries/base/tests/readLitChar.hs
index 7dc01e36e4..e287d2232a 100644
--- a/libraries/base/tests/readLitChar.hs
+++ b/libraries/base/tests/readLitChar.hs
@@ -9,4 +9,7 @@ main =
putStrLn (show $ readLitChar "'A'")
putStrLn (show $ lexLitChar "A")
putStrLn (show $ lexLitChar "'A'")
-
+ putStrLn (show $ lexLitChar "\\243\\&1")
+ putStrLn (show $ lexLitChar "a\\&1")
+ putStrLn (show $ lexLitChar "a\\&\\&1")
+ putStrLn (show $ lexLitChar "a\\&\\&")
diff --git a/libraries/base/tests/readLitChar.stdout b/libraries/base/tests/readLitChar.stdout
index 649c342e4a..db7bc5b1b4 100644
--- a/libraries/base/tests/readLitChar.stdout
+++ b/libraries/base/tests/readLitChar.stdout
@@ -2,3 +2,7 @@
[('\'',"A'")]
[("A","")]
[("'","A'")]
+[("\\243","1")]
+[("a","1")]
+[("a","1")]
+[("a","")]