testsuite: Add test for negative sqrts (#10010)
authorBen Gamari <bgamari.foss@gmail.com>
Sat, 7 Apr 2018 17:31:42 +0000 (13:31 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 10 Apr 2018 15:35:59 +0000 (11:35 -0400)
Reviewers: hvr, alpmestan

Reviewed By: alpmestan

Subscribers: thomie, carter

GHC Trac Issues: #10010

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

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

index a0a9d68..0d7467e 100644 (file)
@@ -25,3 +25,4 @@ test('num010',
      when(platform('i386-apple-darwin'), expect_broken_for(7043, 'ghci')),
      compile_and_run,
      [''])
+test('sqrt', normal, compile_and_run, [''])
diff --git a/libraries/base/tests/Numeric/sqrt.hs b/libraries/base/tests/Numeric/sqrt.hs
new file mode 100644 (file)
index 0000000..a58875a
--- /dev/null
@@ -0,0 +1,3 @@
+main = do
+    print (sqrt (-7 :: Double))
+    print (sqrt (-7 :: Float))
diff --git a/libraries/base/tests/Numeric/sqrt.stdout b/libraries/base/tests/Numeric/sqrt.stdout
new file mode 100644 (file)
index 0000000..913b330
--- /dev/null
@@ -0,0 +1,2 @@
+NaN
+NaN