Skip to content

Commit 7f1928e

Browse files
committed
Add NAR parser-generator and tests
1 parent 9b67337 commit 7f1928e

File tree

8 files changed

+673
-171
lines changed

8 files changed

+673
-171
lines changed

hnix-store-core/.ghci

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
:set -itests

hnix-store-core/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ See `StoreEffects` in [System.Nix.Store] for the available operations
77
on the store.
88

99
[System.Nix.Store]: ./src/System/Nix/Store.hs
10+
11+
12+
Tests
13+
======
14+
15+
- `ghcid --command "cabal repl test-suite:format-tests" --test="Main.main"`

hnix-store-core/hnix-store-core.cabal

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,51 @@ cabal-version: >=1.10
1919
library
2020
exposed-modules: Crypto.Hash.Truncated
2121
, System.Nix.Nar
22+
, System.Nix.Path
2223
, System.Nix.Store
23-
build-depends: base >=4.10 && <4.11,
24-
-- Drop foundation when we can drop cryptonite <0.25
25-
binary,
26-
bytestring, containers, cryptonite, memory, foundation, basement,
27-
text, regex-base, regex-tdfa-text,
28-
hashable, unordered-containers, bytestring
24+
build-depends: base >=4.10 && <4.11
25+
, basement
26+
, bytestring
27+
, binary
28+
, bytestring
29+
, containers
30+
, cryptonite
31+
, directory
32+
, filepath
33+
-- Drop foundation when we can drop cryptonite <0.25
34+
, foundation
35+
, hashable
36+
, memory
37+
, mtl
38+
, regex-base
39+
, regex-tdfa-text
40+
, text
41+
, unix
42+
, unordered-containers
2943
hs-source-dirs: src
3044
default-language: Haskell2010
45+
46+
test-suite format-tests
47+
ghc-options: -rtsopts -fprof-auto
48+
type: exitcode-stdio-1.0
49+
main-is: Driver.hs
50+
other-modules:
51+
NarFormat
52+
hs-source-dirs:
53+
tests
54+
build-depends:
55+
hnix-store-core
56+
, base
57+
, base64-bytestring
58+
, binary
59+
, bytestring
60+
, containers
61+
, directory
62+
, process
63+
, tasty
64+
, tasty-discover
65+
, tasty-hspec
66+
, tasty-hunit
67+
, tasty-quickcheck
68+
, text
69+
default-language: Haskell2010

0 commit comments

Comments
 (0)