Skip to content

Commit 9bbe54a

Browse files
committed
Add test corresponding to builtins.placeholder "foo" in layer above
We were hashing correctly, but base32-ing wrong.
1 parent 0fe7ff5 commit 9bbe54a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

hnix-store-core/tests/Hash.hs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ spec_hash = do
3131

3232
describe "hashing parity with nix-store" $ do
3333

34+
it "produces (base32 . sha256) of \"nix-output:foo\" the same as Nix does at the moment for placeholder \"foo\"" $
35+
shouldBe (printAsBase32 (hash @SHA256 "nix-output:foo"))
36+
"1x0ymrsy7yr7i9wdsqy9khmzc1yy7nvxw6rdp72yzn50285s67j5"
37+
3438
it "produces (base32 . sha1) of \"Hello World\" the same as the thesis" $
3539
shouldBe (printAsBase32 (hash @SHA1 "Hello World"))
3640
"s23c9fs0v32pf6bhmcph5rbqsyl5ak8a"

0 commit comments

Comments
 (0)