From 885cbfd42061eecd22822f75869b056e9642b20c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 15 Oct 2018 22:15:43 -0700 Subject: Only override --quickcheck-tests=N if N is not default value (100). Some of the round-trip tests are set to do a maximum of 25 trials when the default value is given. Closes #4956. --- test/Tests/Readers/HTML.hs | 7 ++++++- test/Tests/Readers/Muse.hs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/Tests/Readers/HTML.hs b/test/Tests/Readers/HTML.hs index eedb99029..514b6bb7b 100644 --- a/test/Tests/Readers/HTML.hs +++ b/test/Tests/Readers/HTML.hs @@ -7,6 +7,7 @@ import Data.Text (Text) import qualified Data.Text as T import Test.Tasty import Test.Tasty.QuickCheck +import Test.Tasty.Options (IsOption(defaultValue)) import Tests.Helpers import Text.Pandoc import Text.Pandoc.Arbitrary () @@ -77,5 +78,9 @@ tests = [ testGroup "base tag" , test htmlNativeDivs "
followed by text" $ "
main content
non-main content" =?> doc (divWith ("", [], [("role", "main")]) (plain (text "main content")) <> plain (text "non-main content")) ] - , testProperty "Round trip" (withMaxSuccess 25 roundTrip) + , askOption $ \(QuickCheckTests numtests) -> + testProperty "Round trip" $ + withMaxSuccess (if QuickCheckTests numtests == defaultValue + then 25 + else numtests) roundTrip ] diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs index 657ac0507..bd63236bd 100644 --- a/test/Tests/Readers/Muse.hs +++ b/test/Tests/Readers/Muse.hs @@ -8,6 +8,7 @@ import Data.Text (Text) import qualified Data.Text as T import Test.Tasty import Test.Tasty.QuickCheck +import Test.Tasty.Options (IsOption(defaultValue)) import Tests.Helpers import Text.Pandoc import Text.Pandoc.Arbitrary () @@ -262,7 +263,11 @@ tests = ] , testGroup "Blocks" - [ testProperty "Round trip" (withMaxSuccess 25 roundTrip) + [ askOption $ \(QuickCheckTests numtests) -> + testProperty "Round trip" $ + withMaxSuccess (if QuickCheckTests numtests == defaultValue + then 25 + else numtests) roundTrip , "Block elements end paragraphs" =: T.unlines [ "First paragraph" , "----" -- cgit v1.2.3