[commit: ghc] master: base: Add test for #14425 (ce9a677)

git at git.haskell.org git at git.haskell.org
Thu Nov 9 23:35:05 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/ce9a67784390735aa9749667934af49665b8402e/ghc

>---------------------------------------------------------------

commit ce9a67784390735aa9749667934af49665b8402e
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Thu Nov 9 17:52:26 2017 -0500

    base: Add test for #14425
    
    Test Plan: Validate
    
    Reviewers: hvr
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #14425
    
    Differential Revision: https://phabricator.haskell.org/D4166


>---------------------------------------------------------------

ce9a67784390735aa9749667934af49665b8402e
 libraries/base/tests/T14425.hs     | 5 +++++
 libraries/base/tests/T14425.stdout | 2 ++
 libraries/base/tests/all.T         | 1 +
 3 files changed, 8 insertions(+)

diff --git a/libraries/base/tests/T14425.hs b/libraries/base/tests/T14425.hs
new file mode 100644
index 0000000..0a93569
--- /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 0000000..2118b0c
--- /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 9055bd5..7839076 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, [''])



More information about the ghc-commits mailing list