From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37590) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e6OF0-0007UO-Fg for guix-patches@gnu.org; Sun, 22 Oct 2017 17:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e6OEx-0006EZ-DS for guix-patches@gnu.org; Sun, 22 Oct 2017 17:57:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47636) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e6OEx-0006ET-93 for guix-patches@gnu.org; Sun, 22 Oct 2017 17:57:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e6OEv-0006Sf-SC for guix-patches@gnu.org; Sun, 22 Oct 2017 17:57:03 -0400 Subject: [bug#28884] [PATCH 08/38] gnu: Add ghc-test-framework-th. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20171018030217.1001-1-s@ricketyspace.net> <20171018030758.1211-1-s@ricketyspace.net> <20171018030758.1211-8-s@ricketyspace.net> Date: Sun, 22 Oct 2017 14:56:24 -0700 In-Reply-To: <20171018030758.1211-8-s@ricketyspace.net> (rsiddharth's message of "Wed, 18 Oct 2017 03:07:28 +0000") Message-ID: <87inf6zw1j.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: rsiddharth Cc: 28884@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable rsiddharth skribis: > * gnu/packages/haskell.scm (ghc-test-framework-th): New variable. Applied after removing the example from the description (see below). Thanks, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/haskell.scm b/gnu/packages/haskell.scm index efcad87c8..298d856ab 100644 --- a/gnu/packages/haskell.scm +++ b/gnu/packages/haskell.scm @@ -9225,49 +9225,8 @@ using Template Haskell") @code{defaultMainGenerator} and @code{testGroupGenerator}. @code{defaultMainGenerator} will extract all functions beginning with -case_, prop_ or test_in the module and put them in a testGroup. - -@verbatim - -- file SomeModule.hs - \( -# LANGUAGE TemplateHaskell #- ) - module SomeModule where - import Test.Framework.TH - import Test.Framework - import Test.HUnit - import Test.Framework.Providers.HUnit - import Test.Framework.Providers.QuickCheck2 - - -- observe this line! - main = $\(defaultMainGenerator) - case_1 = do 1 @=? 1 - case_2 = do 2 @=? 2 - prop_reverse xs = reverse \(reverse xs) == xs - where types = xs::[Int] -@end verbatim - - is the same as - -@verbatim - -- file SomeModule.hs - \( -# LANGUAGE TemplateHaskell #- ) - module SomeModule where - import Test.Framework.TH - import Test.Framework - import Test.HUnit - import Test.Framework.Providers.HUnit - import Test.Framework.Providers.QuickCheck2 - - -- observe this line! - main = - defaultMain [ - testGroup \"SomeModule\" [ testCase \"1\" case_1, testCase \"2\" \ -case_2, testProperty \"reverse\" prop_reverse] - ] - case_1 = do 1 @=? 1 - case_2 = do 2 @=? 2 - prop_reverse xs = reverse \(reverse xs) == xs - where types = xs::[Int] -@end verbatim +@code{case_}, @code{prop_}, or @code{test_} in the module and put them in a +@code{testGroup}. @code{testGroupGenerator} is like @code{defaultMainGenerator} but without @code{defaultMain}. It is useful if you need a function for the testgroup --=-=-=--