From b661cfa6aad800a94dcc25d9d88981b4a387af6e Mon Sep 17 00:00:00 2001 From: panne Date: Mon, 5 Jun 2000 20:54:29 +0000 Subject: [PATCH] [project @ 2000-06-05 20:54:29 by panne] Added tests for gcdInt/gcdInteger --- ghc/tests/numeric/should_run/arith013.hs | 13 +++++++++++ ghc/tests/numeric/should_run/arith013.stdout | 32 ++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 ghc/tests/numeric/should_run/arith013.hs create mode 100644 ghc/tests/numeric/should_run/arith013.stdout diff --git a/ghc/tests/numeric/should_run/arith013.hs b/ghc/tests/numeric/should_run/arith013.hs new file mode 100644 index 0000000..63784de --- /dev/null +++ b/ghc/tests/numeric/should_run/arith013.hs @@ -0,0 +1,13 @@ +-- Test gcdInt/gcdInteger + +import PrelBase ( gcdInt ) +import PrelNum ( gcdInteger ) + +main :: IO () +main = do + test gcdInt [ -42, 0, 105 ] + test gcdInteger [-12193263111263526900, -42, 0, 105, 1234567890 ] + + +test :: Integral a => (a -> a -> a) -> [a] -> IO () +test f xs = mapM_ print [ (a, b, f a b) | a <- xs, b <- reverse xs, a /= 0 || b /= 0 ] diff --git a/ghc/tests/numeric/should_run/arith013.stdout b/ghc/tests/numeric/should_run/arith013.stdout new file mode 100644 index 0000000..ff44097 --- /dev/null +++ b/ghc/tests/numeric/should_run/arith013.stdout @@ -0,0 +1,32 @@ +(-42,105,21) +(-42,0,42) +(-42,-42,42) +(0,105,105) +(0,-42,42) +(105,105,105) +(105,0,105) +(105,-42,21) +(-12193263111263526900,1234567890,1234567890) +(-12193263111263526900,105,15) +(-12193263111263526900,0,12193263111263526900) +(-12193263111263526900,-42,6) +(-12193263111263526900,-12193263111263526900,12193263111263526900) +(-42,1234567890,6) +(-42,105,21) +(-42,0,42) +(-42,-42,42) +(-42,-12193263111263526900,6) +(0,1234567890,1234567890) +(0,105,105) +(0,-42,42) +(0,-12193263111263526900,12193263111263526900) +(105,1234567890,15) +(105,105,105) +(105,0,105) +(105,-42,21) +(105,-12193263111263526900,15) +(1234567890,1234567890,1234567890) +(1234567890,105,15) +(1234567890,0,1234567890) +(1234567890,-42,6) +(1234567890,-12193263111263526900,1234567890) -- 1.7.10.4