about summary refs log tree commit diff
path: root/third_party/nix/src/tests/hash_test.cc (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-08-01 r/1514 fix(3p/nix/hash): initialize HashSink.ctxKane York1-0/+18
Fixup for CL 1492 (addcba11b05500ba28ade309de6bd53f8153a6c4) Additionally, add a test to verify functionality of HashSink. Change-Id: I2a74b925a1b93ed4d3add29021d759c93e813424 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1507 Tested-by: BuildkiteCI Reviewed-by: glittershark <grfn@gws.fyi>
2020-07-28 r/1504 fix(3p/nix/hash): provide a Status-returning constructorKane York1-1/+41
Additionally, add IsValidBase16() to restore the behavior of rejecting invalid base16, which absl's HexStringToBytes does not do. Change-Id: I777a36f5dc787aa54a2aa316d6728f68da129768 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1484 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-28 r/1499 chore(3p/nix/hash): add decoding testsKane York1-0/+19
Change-Id: Ifbeaf1822fa920f929482510ee79a5b24d7976ae Reviewed-on: https://cl.tvl.fyi/c/depot/+/1485 Tested-by: BuildkiteCI Reviewed-by: tazjin <mail@tazj.in>
2020-07-25 r/1462 refactor(3p/nix): Remove custom base64 implementationGriffin Smith1-0/+24
Replace the custom, rather questionable base64 implementation with absl::Base64{Une,E}scape. To make sure that the custom implementation was doing the same thing I've also added a test covering nix::Hash::to_string, which was one function that used it - the test passed prior to the replacement, and continued to pass afterwards. The previous base64Decode function threw an exception on failure - to avoid going too far down the rabbit hole I've replicated that functionality at all call sites, but this should be replaced with more sensible error handling such as StatusOr eventually. Also, before this change: ❯ nix eval -f . users.tazjin.emacs.outPath "/nix/store/g6ri2q8nra96ix20bcsc734r1yyaylb1-tazjins-emacs" And after: ❯ ./result/bin/nix eval -f . users.tazjin.emacs.outPath "/nix/store/g6ri2q8nra96ix20bcsc734r1yyaylb1-tazjins-emacs" Change-Id: Id292ffbb82fe808f3f1b34670afbe7b8c13ad615 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1385 Reviewed-by: tazjin <mail@tazj.in> Tested-by: BuildkiteCI