on master help sign in
Make bin/test reload automatically
9c317adSridhar Ratnakumar
README.md+3−1
@@ -26,7 +26,9 @@ IDE support is available inside `nix-shell`. For example, if you use VS Code, yo
26nix-shell --run "code ."
26nix-shell --run "code ."
27```
27```
28
28
29−Run tests inside ghcid using `bin/test`.
29+### Tests
30+
31+Run `bin/test` for fast-reloading tests. When library sources change, the test script will reload instantly and re-run the tests.
30
32
31## TODOs
33## TODOs
32
34
jrec.cabal+27−55
@@ -1,11 +1,11 @@
1−cabal-version: >=1.10
1+cabal-version: 2.4
2name: jrec
2name: jrec
3version: 0.1.0.0
3version: 0.1.0.0
4synopsis: anonymous records for busy people
4synopsis: anonymous records for busy people
5
5
6-- description:
6-- description:
7−-- bug-reports:
7+bug-reports: https://github.com/juspay/jrec/issues
8−license: BSD3
8+license: BSD-3-Clause
9license-file: LICENSE
9license-file: LICENSE
10author: Artyom Kazak
10author: Artyom Kazak
11maintainer: artyom.kazak@juspay.in
11maintainer: artyom.kazak@juspay.in
@@ -17,44 +17,10 @@ extra-source-files:
17 CHANGELOG.md
17 CHANGELOG.md
18 README.md
18 README.md
19
19
20−library
20+-- A common stanza to share with tests, so that ghcid (bin/test) will reload
21− hs-source-dirs: src
21+-- instantly when the library sources change (without us having to restart it).
22− exposed-modules:
22+common library-common
23− JRec
23+ default-language: Haskell2010
24− JRec.Internal
25− other-modules:
26− JRec.Tuple
27− JRec.Field
28−
29− default-extensions:
30− BlockArguments
31− DataKinds
32− DeriveGeneric
33− DerivingStrategies
34− DuplicateRecordFields
35− FlexibleContexts
36− FlexibleInstances
37− FunctionalDependencies
38− GADTs
39− InstanceSigs
40− KindSignatures
41− LambdaCase
42− MultiParamTypeClasses
43− OverloadedLabels
44− OverloadedStrings
45− PatternSynonyms
46− RankNTypes
47− ScopedTypeVariables
48− StandaloneDeriving
49− TupleSections
50− TypeFamilies
51− TypeOperators
52− UndecidableInstances
53− UnicodeSyntax
54− ViewPatterns
55− ConstraintKinds
56− PackageImports
57−
58 build-depends:
24 build-depends:
59 aeson
25 aeson
60 , base >=4.13 && <4.15
26 , base >=4.13 && <4.15
@@ -68,20 +34,6 @@ library
68 , lens
34 , lens
69 , mtl
35 , mtl
70 , text
36 , text
71−
72− default-language: Haskell2010
73−
74−test-suite jrec-test
75− type: exitcode-stdio-1.0
76− hs-source-dirs: test
77− main-is: Spec.hs
78− build-depends:
79− base,
80− hspec,
81− QuickCheck,
82− lens,
83− jrec
84− default-language: Haskell2010
85 default-extensions:
37 default-extensions:
86 BlockArguments
38 BlockArguments
87 DataKinds
39 DataKinds
@@ -109,5 +61,25 @@ test-suite jrec-test
109 UnicodeSyntax
61 UnicodeSyntax
110 ViewPatterns
62 ViewPatterns
111 ConstraintKinds
63 ConstraintKinds
64+ PackageImports
112
65
66+library
67+ import: library-common
68+ hs-source-dirs: src
69+ exposed-modules:
70+ JRec
71+ JRec.Internal
72+ other-modules:
73+ JRec.Tuple
74+ JRec.Field
113
75
76+test-suite jrec-test
77+ import: library-common
78+ type: exitcode-stdio-1.0
79+ hs-source-dirs: test, src
80+ main-is: Spec.hs
81+ build-depends:
82+ base,
83+ hspec,
84+ QuickCheck,
85+ lens