-
Notifications
You must be signed in to change notification settings - Fork 103
Tests: Specify maxSize for long-running properties #517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -260,7 +260,7 @@ tests = | |
| \(x :: HMKI) y -> HM.isSubmapOf x (HM.union x y) | ||
| , testProperty "m1\\m2 ⊆ m1" $ | ||
| \(m1 :: HMKI) (m2 :: HMKI) -> HM.isSubmapOf (HM.difference m1 m2) m1 | ||
| , testProperty "m1 ∩ m2 ≠ ∅ ⇒ m1 ⊈ m1\\m2 " $ | ||
| , testProperty "m1 ∩ m2 ≠ ∅ ⇒ m1 ⊈ m1\\m2 " $ QC.withMaxSize 200 $ | ||
| \(m1 :: HMKI) (m2 :: HMKI) -> | ||
| not (HM.null (HM.intersection m1 m2)) ==> | ||
| not (HM.isSubmapOf m1 (HM.difference m1 m2)) | ||
|
|
@@ -303,9 +303,9 @@ tests = | |
| \(Fn3 f) (x :: HMKI) y -> isValid (HM.unionWithKey f x y) | ||
| ] | ||
| , testGroup "unions" | ||
| [ testProperty "model" $ | ||
| [ testProperty "model" $ QC.withMaxSize 200 $ | ||
| \(ms :: [HMKI]) -> toOrdMap (HM.unions ms) === M.unions (map toOrdMap ms) | ||
| , testProperty "valid" $ | ||
| , testProperty "valid" $ QC.withMaxSize 200 $ | ||
| \(ms :: [HMKI]) -> isValid (HM.unions ms) | ||
| ] | ||
| , testGroup "difference" | ||
|
|
@@ -323,28 +323,28 @@ tests = | |
| \(Fn2 f) (x :: HMK A) (y :: HMK B) -> isValid (HM.differenceWith f x y) | ||
| ] | ||
| , testGroup "intersection" | ||
| [ testProperty "model" $ | ||
| [ testProperty "model" $ QC.withMaxSize 200 $ | ||
| \(x :: HMKI) (y :: HMKI) -> | ||
| toOrdMap (HM.intersection x y) === M.intersection (toOrdMap x) (toOrdMap y) | ||
| , testProperty "valid" $ | ||
| , testProperty "valid" $ QC.withMaxSize 200 $ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does this test take a long time? I'd much rather have a slightly more complex There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I dug through the validity code, and it all looks like it should be fast. That makes me wonder why this test would take a long time There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed I was misled when I tried to run these tests with |
||
| \(x :: HMKI) (y :: HMKI) -> | ||
| isValid (HM.intersection x y) | ||
| ] | ||
| , testGroup "intersectionWith" | ||
| [ testProperty "model" $ | ||
| [ testProperty "model" $ QC.withMaxSize 200 $ | ||
| \(Fn2 f :: Fun (A, B) C) (x :: HMK A) (y :: HMK B) -> | ||
| toOrdMap (HM.intersectionWith f x y) === M.intersectionWith f (toOrdMap x) (toOrdMap y) | ||
| , testProperty "valid" $ | ||
| , testProperty "valid" $ QC.withMaxSize 200 $ | ||
| \(Fn2 f :: Fun (A, B) C) (x :: HMK A) (y :: HMK B) -> | ||
| isValid (HM.intersectionWith f x y) | ||
| ] | ||
| , testGroup "intersectionWithKey" | ||
| [ testProperty "model" $ | ||
| [ testProperty "model" $ QC.withMaxSize 200 $ | ||
| \(Fn3 f :: Fun (Key, A, B) C) (x :: HMK A) (y :: HMK B) -> | ||
| toOrdMap (HM.intersectionWithKey f x y) | ||
| === | ||
| M.intersectionWithKey f (toOrdMap x) (toOrdMap y) | ||
| , testProperty "valid" $ | ||
| , testProperty "valid" $ QC.withMaxSize 200 $ | ||
| \(Fn3 f :: Fun (Key, A, B) C) (x :: HMK A) (y :: HMK B) -> | ||
| isValid (HM.intersectionWithKey f x y) | ||
| ] | ||
|
|
@@ -360,12 +360,12 @@ tests = | |
| \(Fn f :: Fun A B) (m :: HMK A) -> isValid (HM.map f m) | ||
| ] | ||
| , testGroup "traverseWithKey" | ||
| [ testProperty "model" $ QC.mapSize (\s -> s `div` 8) $ | ||
| [ testProperty "model" $ QC.withMaxSize 22 $ | ||
| \(x :: HMKI) -> | ||
| let f k v = [keyToInt k + v + 1, keyToInt k + v + 2] | ||
| ys = HM.traverseWithKey f x | ||
| in List.sort (fmap toOrdMap ys) === List.sort (M.traverseWithKey f (toOrdMap x)) | ||
| , testProperty "valid" $ QC.mapSize (\s -> s `div` 8) $ | ||
| , testProperty "valid" $ QC.withMaxSize 22 $ | ||
| \(x :: HMKI) -> | ||
| let f k v = [keyToInt k + v + 1, keyToInt k + v + 2] | ||
| ys = HM.traverseWithKey f x | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we even have this property?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. It seems to be the same idea as the
m ⊈ delete k mtest below. I've deleted this test a few other ones in #518.