summaryrefslogtreecommitdiff
path: root/libraries/base/tests
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-11-09 17:52:26 -0500
committerBen Gamari <ben@smart-cactus.org>2017-11-09 18:31:21 -0500
commitce9a67784390735aa9749667934af49665b8402e (patch)
tree4758b1a1c84bd4e917416572a609e2d11f5d0576 /libraries/base/tests
parent977305346cffad70f0977467153cce52b2d1ae0b (diff)
downloadhaskell-ce9a67784390735aa9749667934af49665b8402e.tar.gz
base: Add test for #14425
Test Plan: Validate Reviewers: hvr Subscribers: rwbarton, thomie GHC Trac Issues: #14425 Differential Revision: https://phabricator.haskell.org/D4166
Diffstat (limited to 'libraries/base/tests')
-rw-r--r--libraries/base/tests/T14425.hs5
-rw-r--r--libraries/base/tests/T14425.stdout2
-rw-r--r--libraries/base/tests/all.T1
3 files changed, 8 insertions, 0 deletions
diff --git a/libraries/base/tests/T14425.hs b/libraries/base/tests/T14425.hs
new file mode 100644
index 0000000000..0a935693d3
--- /dev/null
+++ b/libraries/base/tests/T14425.hs
@@ -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
index 0000000000..2118b0ccd4
--- /dev/null
+++ b/libraries/base/tests/T14425.stdout
@@ -0,0 +1,2 @@
+0 % 1
+0 % 1
diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T
index 9055bd5b45..7839076b57 100644
--- a/libraries/base/tests/all.T
+++ b/libraries/base/tests/all.T
@@ -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, [''])