From b5ec4e7d0f847215677752b191677379f045efb0 Mon Sep 17 00:00:00 2001 From: "simon.hengel" Date: Fri, 2 Apr 2010 14:11:53 +0000 Subject: Add tests for interactive examples --- tests/tests/Examples.hs | 34 +++++++ tests/tests/Examples.html.ref | 208 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 242 insertions(+) create mode 100644 tests/tests/Examples.hs create mode 100644 tests/tests/Examples.html.ref diff --git a/tests/tests/Examples.hs b/tests/tests/Examples.hs new file mode 100644 index 00000000..ed22b614 --- /dev/null +++ b/tests/tests/Examples.hs @@ -0,0 +1,34 @@ +module Examples where + +-- | Fibonacci number of given 'Integer'. +-- +-- Examples: +-- +-- ghci> fib 5 +-- 5 +-- ghci> fib 10 +-- 55 +-- +-- ghci> fib 10 +-- 55 +-- +-- One more Example: +-- +-- ghci> fib 5 +-- 5 +-- +-- One more Example: +-- +-- ghci> fib 5 +-- 5 +-- +-- Example with an import: +-- +-- ghci> import Data.Char +-- ghci> isSpace 'a' +-- False +-- +fib :: Integer -> Integer +fib 0 = 0 +fib 1 = 1 +fib n = fib (n - 1) + fib (n - 2) diff --git a/tests/tests/Examples.html.ref b/tests/tests/Examples.html.ref new file mode 100644 index 00000000..64634d26 --- /dev/null +++ b/tests/tests/Examples.html.ref @@ -0,0 +1,208 @@ + + +Examples
 ContentsIndex
Examples
Synopsis
fib :: Integer -> Integer
Documentation
fib :: Integer -> Integer

Fibonacci number of given Integer. +

Examples: +

ghci> fib 5
+5
+ghci> fib 10
+55
+
ghci> fib 10
+55
+

One more Example: +

ghci> fib 5
+5
+

One more Example: +

ghci> fib 5
+5
+

Example with an import: +

ghci> import Data.Char
+ghci> isSpace 'a'
+False
+
Produced by Haddock version 2.7.2
-- cgit v1.2.3