split 0.2.3 → 0.2.3.1
raw patch · 3 files changed
+16/−4 lines, 3 filesdep ~base
Dependency ranges changed: base
Files
- CHANGES +6/−0
- split.cabal +2/−2
- test/Properties.hs +8/−2
CHANGES view
@@ -1,3 +1,9 @@+* 0.2.3.1 (2 May 2016)++ - Fix a test case which was causing occasional spurious test suite+ failures due to too many discarded tests. Thanks to Doug+ Beardsley and Peter Simons for reporting the issue.+ * 0.2.3 (12 January 2016) - New function 'divvy' (with associated tests) from Tim Washington.
split.cabal view
@@ -1,5 +1,5 @@ Name: split-Version: 0.2.3+Version: 0.2.3.1 Stability: stable Description: A collection of various methods for splitting@@ -35,7 +35,7 @@ Category: List Build-type: Simple Cabal-Version: >= 1.10-Tested-with: GHC ==7.0.4, GHC ==7.2.1, GHC ==7.4.*, GHC ==7.6.1, GHC ==7.8.3, GHC==7.10.3+Tested-with: GHC ==7.0.4, GHC ==7.2.1, GHC ==7.4.*, GHC ==7.6.1, GHC ==7.8.3, GHC==7.10.3, GHC==8.0.1 Bug-reports: http://hub.darcs.net/byorgey/split/issues Test-suite split-tests
test/Properties.hs view
@@ -363,8 +363,14 @@ prop_chop_words s = words s' == (filter (not . null) . chop (span (not . isSpace) . dropWhile isSpace) $ s') where s' = map unEltWS s -prop_divvy_evenly :: [Elt] -> Positive Int -> Property-prop_divvy_evenly elems (Positive n) = (length elems `mod` n == 0) ==> concat (divvy n n elems) == elems+prop_divvy_evenly :: [Elt] -> Positive Int -> Bool+prop_divvy_evenly elems (Positive n) = concat (divvy n n elems') == elems'+ where+ -- Chop off the smallest possible tail of elems to make the length+ -- evenly divisible by n. This property used to have a+ -- precondition (length elemens `mod` n == 0), but that led to too+ -- many discarded test cases and occasional test suite failures.+ elems' = take ((length elems `div` n) * n) elems prop_divvy_discard_remainder :: [Elt] -> Positive Int -> Bool prop_divvy_discard_remainder elems (Positive n) =