diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-10-15 22:15:43 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-10-15 22:15:43 -0700 |
commit | 885cbfd42061eecd22822f75869b056e9642b20c (patch) | |
tree | 5250b64b0f99870717cafdd9e73e4f060a4d40b0 /test | |
parent | 85394d403464f25db2ffd586dcc9893fc984877c (diff) | |
download | pandoc-885cbfd42061eecd22822f75869b056e9642b20c.tar.gz |
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.
Diffstat (limited to 'test')
-rw-r--r-- | test/Tests/Readers/HTML.hs | 7 | ||||
-rw-r--r-- | test/Tests/Readers/Muse.hs | 7 |
2 files changed, 12 insertions, 2 deletions
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 "<main> followed by text" $ "<main>main content</main>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" , "----" |