summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/Numeric/num004.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/lib/Numeric/num004.hs')
-rw-r--r--testsuite/tests/lib/Numeric/num004.hs20
1 files changed, 20 insertions, 0 deletions
diff --git a/testsuite/tests/lib/Numeric/num004.hs b/testsuite/tests/lib/Numeric/num004.hs
new file mode 100644
index 0000000000..0eb2bee5b0
--- /dev/null
+++ b/testsuite/tests/lib/Numeric/num004.hs
@@ -0,0 +1,20 @@
+-- Exercising Numeric.readSigned a bit
+--
+module Main(main) where
+
+import Numeric
+import Data.Char
+
+main =
+ let
+ rd :: ReadS Integer
+ rd = readSigned (readInt 10 (isDigit) (digitToInt))
+ in
+ do
+ print (rd (show (343023920121::Integer)))
+ print (rd (show (3430239::Int)))
+ print (rd (show (-0 :: Int)))
+ print (rd (show (591125662431 `div` (517::Int))))
+ print (rd (show (-111::Int)))
+ print (rd (show (232189458241::Integer)))
+