From ea9c35d3cc2ef65643718e696007ba3569099e1e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 1 Mar 2006 15:43:37 +0000 Subject: [PATCH] * Test `nix-store --add' and `nix-store -q --hash'. --- tests/Makefile.am | 8 ++++---- tests/add.sh | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 tests/add.sh diff --git a/tests/Makefile.am b/tests/Makefile.am index 225f780b8..3a1e07891 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,10 +13,10 @@ fallback.sh: fallback.nix gc-concurrent.sh: gc-concurrent.nix gc-concurrent2.nix user-envs.sh: user-envs.nix -TESTS = init.sh hash.sh lang.sh simple.sh dependencies.sh locking.sh parallel.sh \ - build-hook.sh substitutes.sh substitutes2.sh fallback.sh nix-push.sh gc.sh \ - gc-concurrent.sh verify.sh nix-pull.sh referrers.sh user-envs.sh \ - logging.sh nix-build.sh misc.sh +TESTS = init.sh hash.sh lang.sh add.sh simple.sh dependencies.sh \ + locking.sh parallel.sh build-hook.sh substitutes.sh substitutes2.sh \ + fallback.sh nix-push.sh gc.sh gc-concurrent.sh verify.sh nix-pull.sh \ + referrers.sh user-envs.sh logging.sh nix-build.sh misc.sh XFAIL_TESTS = diff --git a/tests/add.sh b/tests/add.sh new file mode 100644 index 000000000..b6ae3ebea --- /dev/null +++ b/tests/add.sh @@ -0,0 +1,13 @@ +source common.sh + +file=./add.sh + +path=$($nixstore --add $file) + +echo $path + +hash=$($nixstore -q --hash $path) + +echo $hash + +test "$hash" = "sha256:$(nix-hash --type sha256 --base32 $file)"