base: Add test for #14425
authorBen Gamari <bgamari.foss@gmail.com>
Thu, 9 Nov 2017 22:52:26 +0000 (17:52 -0500)
committerBen Gamari <ben@smart-cactus.org>
Thu, 9 Nov 2017 23:31:21 +0000 (18:31 -0500)
Test Plan: Validate

Reviewers: hvr

Subscribers: rwbarton, thomie

GHC Trac Issues: #14425

Differential Revision: https://phabricator.haskell.org/D4166

libraries/base/tests/T14425.hs [new file with mode: 0644]
libraries/base/tests/T14425.stdout [new file with mode: 0644]
libraries/base/tests/all.T

diff --git a/libraries/base/tests/T14425.hs b/libraries/base/tests/T14425.hs
new file mode 100644 (file)
index 0000000..0a93569
--- /dev/null
@@ -0,0 +1,5 @@
+import Data.Ratio
+
+main = do
+  print (approxRational (0 % 1 :: Ratio Int) (1 % 10)) -- 0%1, correct
+  print (approxRational (0 % 1 :: Ratio Word) (1 % 10)) -- 1%1, incorrect
diff --git a/libraries/base/tests/T14425.stdout b/libraries/base/tests/T14425.stdout
new file mode 100644 (file)
index 0000000..2118b0c
--- /dev/null
@@ -0,0 +1,2 @@
+0 % 1
+0 % 1
index 9055bd5..7839076 100644 (file)
@@ -221,3 +221,4 @@ test('T3474',
      [stats_num_field('max_bytes_used', [ (wordsize(64), 44504, 5) ]),
       only_ways(['normal'])],
      compile_and_run, ['-O'])
+test('T14425', expect_broken(14425), compile_and_run, [''])