string-random 0.1.3.0 → 0.1.4.0
raw patch · 2 files changed
+49/−58 lines, 2 files
Files
- string-random.cabal +48/−57
- test/string-random-quickcheck.hs +1/−1
string-random.cabal view
@@ -1,89 +1,79 @@ cabal-version: 1.12+name: string-random+version: 0.1.4.0+synopsis:+ A library for generating random string from a regular experession --- This file has been generated from package.yaml by hpack version 0.33.0.------ see: https://github.com/sol/hpack------ hash: fa58d59933cbb63acc6f6b5b8fc0952e8c53ae7d87b1620cdec86259ef329e2c+description:+ With this package you can generate random strings from+ regular expressions. If you are using QuickCheck, you can+ also check the quickcheck-string-random package. -name: string-random-version: 0.1.3.0-synopsis: A library for generating random string from a regular experession-description: With this package you can generate random strings from- regular expressions. If you are using QuickCheck, you can- also check the quickcheck-string-random package.-category: Text-homepage: https://github.com/hiratara/hs-string-random#readme-bug-reports: https://github.com/hiratara/hs-string-random/issues-author: Masahiro Honma-maintainer: hiratara@cpan.org-copyright: Copyright (C) 2016- hiratara-license: BSD3-license-file: LICENSE-tested-with: GHC==8.0.1-build-type: Simple+category: Text+homepage: https://github.com/hiratara/hs-string-random#readme+bug-reports: https://github.com/hiratara/hs-string-random/issues+author: Masahiro Honma+maintainer: hiratara@cpan.org+copyright: Copyright (C) 2016- hiratara+license: BSD3+license-file: LICENSE+tested-with: GHC ==8.10.3+build-type: Simple source-repository head- type: git+ type: git location: https://github.com/hiratara/hs-string-random library+ -- cabal-fmt: expand src exposed-modules:- Text.StringRandom- Text.StringRandom.Parser- other-modules:- Paths_string_random- hs-source-dirs:- src+ Text.StringRandom+ Text.StringRandom.Parser++ hs-source-dirs: src build-depends:- attoparsec >=0.13.1 && <0.14- , base >=4.9 && <5- , containers >=0.5.7.1 && <0.7- , random >=1.1 && <1.3- , text >=1.2.2.1 && <1.3- , transformers >=0.5.2.0 && <0.6+ attoparsec >=0.13.1 && <0.14+ , base >=4.9 && <5+ , containers >=0.5.7.1 && <0.7+ , random >=1.1 && <1.3+ , text >=1.2.2.1 && <1.3+ , transformers >=0.5.2.0 && <0.6+ default-language: Haskell2010 executable hstrrand- main-is: hstrrand.hs- other-modules:- Paths_string_random- hs-source-dirs:- app- ghc-options: -O2 -threaded -Wall+ main-is: hstrrand.hs+ hs-source-dirs: app+ ghc-options: -O2 -threaded -Wall build-depends:- base >=4.9 && <5+ base >=4.9 && <5 , optparse-applicative , string-random , text+ default-language: Haskell2010 test-suite string-random-quickcheck- type: exitcode-stdio-1.0- main-is: string-random-quickcheck.hs- other-modules:- Paths_string_random- hs-source-dirs:- test- ghc-options: -threaded -rtsopts -with-rtsopts=-N+ type: exitcode-stdio-1.0+ main-is: string-random-quickcheck.hs+ hs-source-dirs: test+ ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends:- QuickCheck- , base+ base , pcre-heavy+ , QuickCheck , string-random , tasty , tasty-quickcheck , text+ default-language: Haskell2010 test-suite string-random-test- type: exitcode-stdio-1.0- main-is: string-random-test.hs- other-modules:- Paths_string_random- hs-source-dirs:- test- ghc-options: -threaded -rtsopts -with-rtsopts=-N+ type: exitcode-stdio-1.0+ main-is: string-random-test.hs+ hs-source-dirs: test+ ghc-options: -threaded -rtsopts -with-rtsopts=-N build-depends: base , bytestring@@ -92,4 +82,5 @@ , tasty , tasty-hunit , text+ default-language: Haskell2010
test/string-random-quickcheck.hs view
@@ -12,7 +12,7 @@ import Text.Regex.PCRE.Heavy (compileM, (=~)) regexp :: QC.Gen Text.Text-regexp = QC.MkGen $ \(QC.QCGen g) _ -> StringRandom.stringRandom g regregexp+regexp = QC.MkGen $ \g _ -> StringRandom.stringRandom g regregexp where regregexp = "((\\w|" <> classes <> "|\\(\\w+\\))(\\{[0-4],[5-9]\\}|\\*|\\+|))*" classes = "\\[^?(\\w|" <> escaped <> "|a-z)+-?\\]" escaped = "\\\\[dDwWsSnr\\[\\]|.(){}^$-]"