loc-test 0.1.3.12 → 0.1.3.13
raw patch · 5 files changed
+83/−49 lines, 5 filesdep ~basedep ~containersdep ~hedgehogPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, containers, hedgehog
API changes (from Hackage documentation)
Files
- changelog.md +35/−0
- license.txt +1/−1
- loc-test.cabal +14/−9
- readme.md +3/−0
- src/Test/Loc/Hedgehog/Gen.hs +30/−39
+ changelog.md view
@@ -0,0 +1,35 @@+### 0.1.3.13 (2023-01-10)++Metadata changes only++### 0.1.3.12 (2022-09-09)++Support hedgehog 1.2++### 0.1.3.10 (2022-01-13)++Support GHC 9.0 and 9.2++Tighten dependency version bounds++### 0.1.3.8 (2020-05-20)++Support GHC 8.10++### 0.1.3.6 (2020-03-15)++Support GHC 8.8++### Older++The change log was not maintained before this point.++- 0.1.3.4 (2018-11-22)+- 0.1.3.3 (2018-08-23)+- 0.1.3.2 (2017-12-03)+- 0.1.3.1 (2017-08-20)+- 0.1.3.0 (2017-07-22)+- 0.1.2.1 (2017-05-16)+- 0.1.2.0 (2017-05-07)+- 0.1.1.0 (2017-05-07)+- 0.1.0.0 (2017-05-07)
license.txt view
@@ -1,4 +1,4 @@-Copyright 2017 Chris Martin+Copyright 2017 Mission Valley Software LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
loc-test.cabal view
@@ -1,17 +1,18 @@ cabal-version: 3.0 name: loc-test-version: 0.1.3.12+version: 0.1.3.13 -synopsis: Test-related utilities related to the /loc/ package.+synopsis: Hedgehog generators for loc description:- Test-related utilities related to the /loc/ package.- Currently contains only Hedgehog generators.+ This package contains Hedgehog generators types defined+ in the /loc/ package. category: Testing -homepage: https://github.com/typeclasses/loc+homepage: https://github.com/typeclasses/loc-test+bug-reports: https://github.com/typeclasses/loc-test/issues author: Chris Martin maintainer: Chris Martin, Julie Moronuki@@ -20,8 +21,12 @@ license: Apache-2.0 license-file: license.txt -build-type: Simple+extra-source-files: *.md +source-repository head+ type: git+ location: git://github.com/typeclasses/loc-test.git+ library default-language: Haskell2010 hs-source-dirs: src@@ -29,7 +34,7 @@ ghc-options: -Wall exposed-modules: Test.Loc.Hedgehog.Gen build-depends:- base >= 4.14 && < 4.17- , containers >= 0.6.5.1 && < 0.7- , hedgehog ^>= 1.0.2 || ^>= 1.1 || ^>= 1.2+ , base ^>= 4.14 || ^>= 4.15 || ^>= 4.16+ , containers ^>= 0.6.4+ , hedgehog ^>= 1.0.5 || ^>= 1.1 || ^>= 1.2 , loc ^>= 0.1.3
+ readme.md view
@@ -0,0 +1,3 @@+This package contains Hedgehog generators for type in the [loc] package.++ [loc]: https://hackage.haskell.org/package/loc
src/Test/Loc/Hedgehog/Gen.hs view
@@ -68,8 +68,7 @@ -} boundsSize :: Num n => (n, n) -> n-boundsSize (a, b) =- 1 + b - a+boundsSize (a, b) = 1 + b - a --------------------------------------------------------------------------------@@ -81,23 +80,21 @@ @'pos' a b@ generates a number on the linear range /a/ to /b/. -}-pos :: (ToNat n, Num n)- => Bounds n -- ^ Minimum and maximum value to generate- -> Gen n-pos (a, b) =- let+pos :: (ToNat n, Num n) =>+ Bounds n -- ^ Minimum and maximum value to generate+ -> Gen n+pos (a, b) = fromInteger . toInteger <$> Gen.integral range+ where range = Range.linear (toNat a) (toNat b)- in- fromInteger . toInteger <$> Gen.integral range {- | @'line' a b@ generates a line number on the linear range /a/ to /b/. -}-line- :: Bounds Line -- ^ Minimum and maximum line number- -> Gen Line+line ::+ Bounds Line -- ^ Minimum and maximum line number+ -> Gen Line line = pos {- |@@ -106,17 +103,16 @@ -} line' :: Gen Line-line' =- line (1, defMaxLine)+line' = line (1, defMaxLine) {- | @'column' a b@ generates a column number on the linear range /a/ to /b/. -}-column- :: Bounds Column -- ^ Minimum and maximum column number- -> Gen Column+column ::+ Bounds Column -- ^ Minimum and maximum column number+ -> Gen Column column = pos {- |@@ -125,8 +121,7 @@ -} column' :: Gen Column-column' =- column (1, defMaxColumn)+column' = column (1, defMaxColumn) --------------------------------------------------------------------------------@@ -139,13 +134,12 @@ bounded by @lineBounds@ and column number bounded by @columnBounds@. -}-loc- :: Bounds Line -- ^ Minimum and maximum line number- -> Bounds Column -- ^ Minimum and maximum column number- -> Gen Loc+loc ::+ Bounds Line -- ^ Minimum and maximum line number+ -> Bounds Column -- ^ Minimum and maximum column number+ -> Gen Loc loc lineBounds columnBounds =- Loc.loc <$> line lineBounds- <*> column columnBounds+ Loc.loc <$> line lineBounds <*> column columnBounds {- | @@ -153,8 +147,7 @@ -} loc' :: Gen Loc-loc' =- loc (1, defMaxLine) (1, defMaxColumn)+loc' = loc (1, defMaxLine) (1, defMaxColumn) --------------------------------------------------------------------------------@@ -168,10 +161,10 @@ numbers are bounded by @columnBounds@. -}-span- :: Bounds Line -- ^ Minimum and maximum line number- -> Bounds Column -- ^ Minimum and maximum column number- -> Gen Span+span ::+ Bounds Line -- ^ Minimum and maximum line number+ -> Bounds Column -- ^ Minimum and maximum column number+ -> Gen Span span lineBounds columnBounds@(minColumn, maxColumn) = let lines :: Gen (Line, Line)@@ -216,8 +209,7 @@ -} span' :: Gen Span-span' =- span (1, defMaxLine) (1, defMaxColumn)+span' = span (1, defMaxLine) (1, defMaxColumn) --------------------------------------------------------------------------------@@ -231,10 +223,10 @@ and whose column numbers are bounded by @columnBounds@. -}-area- :: Bounds Line -- ^ Minimum and maximum line number- -> Bounds Column -- ^ Minimum and maximum column number- -> Gen Area+area ::+ Bounds Line -- ^ Minimum and maximum line number+ -> Bounds Column -- ^ Minimum and maximum column number+ -> Gen Area area lineBounds columnBounds = fold . snd . mapAccumL f Nothing . Set.toAscList . Set.fromList <$> locs @@ -261,5 +253,4 @@ -} area' :: Gen Area-area' =- area (1, defMaxLine) (1, defMaxColumn)+area' = area (1, defMaxLine) (1, defMaxColumn)