Skip to content

Commit

Permalink
Limit the size of QuickCheck-generated patterns.
Browse files Browse the repository at this point in the history
See #259.
  • Loading branch information
quasicomputational committed Mar 27, 2020
1 parent d7e1496 commit e3f8bb9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 3 additions & 2 deletions doctest.cabal
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
cabal-version: 1.12

-- This file has been generated from package.yaml by hpack version 0.32.0.
-- This file has been generated from package.yaml by hpack version 0.33.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: c49494d6a77aec3f741c557db5db5fecb5c705acb3a4d36aad26c6b77921946f
-- hash: 53ffc034338153cc76d198a3ba3f05173f47d8bfe1c186f319401ec35e58446a

name: doctest
version: 0.16.2
Expand Down Expand Up @@ -241,6 +241,7 @@ test-suite spec
, ghc >=7.0 && <8.11
, ghc-paths >=0.1.0.9
, hspec >=2.3.0
, hspec-core >=2.3.0
, mockery
, process
, setenv
Expand Down
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ tests:
dependencies:
- HUnit
- hspec >= 2.3.0
- hspec-core >= 2.3.0
- QuickCheck >= 2.13.1
- stringbuilder >= 0.4
- silently >= 1.2.4
Expand Down
9 changes: 6 additions & 3 deletions test/Runner/ExampleSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Prelude.Compat

import Data.String
import Test.Hspec
import Test.Hspec.Core.QuickCheck (modifyMaxSize)
import Test.QuickCheck

import Parse
Expand Down Expand Up @@ -59,9 +60,11 @@ spec = do
mkResult ["foo", WildCardLine, "bar"] ["foo", "baz", "bazoom", "bar"]
`shouldBe` Equal

it "matches an arbitrary number of lines (quickcheck)" $ do
property $ \xs -> mkResult (lineToExpected xs) (lineToActual xs)
`shouldBe` Equal
-- See https://github.com/sol/doctest/issues/259
modifyMaxSize (const 8) $
it "matches an arbitrary number of lines (quickcheck)" $ do
property $ \xs -> mkResult (lineToExpected xs) (lineToActual xs)
`shouldBe` Equal

context "with WildCardChunk" $ do
it "matches an arbitrary line chunk" $ do
Expand Down

0 comments on commit e3f8bb9

Please sign in to comment.