summaryrefslogtreecommitdiff
path: root/testsuite/tests/lib/Numeric/num007.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/lib/Numeric/num007.hs')
-rw-r--r--testsuite/tests/lib/Numeric/num007.hs17
1 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/lib/Numeric/num007.hs b/testsuite/tests/lib/Numeric/num007.hs
new file mode 100644
index 0000000000..1c40ecfdbd
--- /dev/null
+++ b/testsuite/tests/lib/Numeric/num007.hs
@@ -0,0 +1,17 @@
+-- Exercising the reading of positive numbers at various bases.
+--
+module Main(main) where
+
+import Numeric
+
+main =
+ do
+ putStrLn (show (readOct "00000111"))
+ putStrLn (show (readDec "00000111"))
+ putStrLn (show (readHex "00000111"))
+ putStrLn (show (readOct "-24"))
+ putStrLn (show (readDec "-24"))
+ putStrLn (show (readHex "-24"))
+ putStrLn (show ((readOct ::ReadS Integer) "3248784372843778438743"))
+ putStrLn (show ((readDec ::ReadS Integer) "3248784372843778438743"))
+ putStrLn (show ((readHex ::ReadS Integer) "3248784372843778438743"))