From 26f0a2204a0bdb41b1d6aa5430544c404b77e638 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 8 Jul 2011 20:26:34 -0400 Subject: [PATCH] Re-enable the non-doc tests. Add a doctest for the flatten function. --- src/Misc.hs | 6 ++++++ test/TestSuite.hs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Misc.hs b/src/Misc.hs index 48482b4..34c682e 100644 --- a/src/Misc.hs +++ b/src/Misc.hs @@ -25,6 +25,12 @@ factorial n -- | Takes a three-dimensional list, and flattens it into a -- one-dimensional one. +-- +-- Examples: +-- +-- >>> flatten [ [[1,2], [3,4]], [[5,6], [7,8]] ] +-- [1,2,3,4,5,6,7,8] +-- flatten :: [[[a]]] -> [a] flatten xs = concat $ concat xs diff --git a/test/TestSuite.hs b/test/TestSuite.hs index 7f49670..756bcf3 100644 --- a/test/TestSuite.hs +++ b/test/TestSuite.hs @@ -19,7 +19,7 @@ import Tests.Tetrahedron as TT main :: IO () main = do dt <- docTest ["src/Everything.hs"] ["-isrc"] - defaultMain $ [dt] -- ++ tests + defaultMain $ [dt] ++ tests -- | Defined so that my test names fit on one line. tc :: Test.Framework.Providers.API.TestName -> Test.HUnit.Assertion -> Test.Framework.Test -- 2.43.2