diff options
author | Jason David Davies <jasondavies@apache.org> | 2010-01-12 19:29:23 +0000 |
---|---|---|
committer | Jason David Davies <jasondavies@apache.org> | 2010-01-12 19:29:23 +0000 |
commit | b9f59ca2986075112ff1de42320168affa10921e (patch) | |
tree | 5e2a443b255803cd1c4f75689055db2099fd9c4e /test | |
parent | 84fd4ae77ef7b4c53a9159394747676a1c65ab51 (diff) |
Add utility for verifying hashes.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@898477 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test')
-rwxr-xr-x | test/etap/040-util.t | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/etap/040-util.t b/test/etap/040-util.t index 6d6da2c1..4500d38a 100755 --- a/test/etap/040-util.t +++ b/test/etap/040-util.t @@ -17,7 +17,7 @@ main(_) -> test_util:init_code_path(), application:start(crypto), - etap:plan(11), + etap:plan(16), case (catch test()) of ok -> etap:end_tests(); @@ -88,4 +88,16 @@ test() -> etap:ok(not couch_util:should_flush(), "Checking to flush invokes GC."), + % verify + etap:is(true, couch_util:verify("It4Vooya", "It4Vooya"), + "String comparison."), + etap:is(false, couch_util:verify("It4VooyaX", "It4Vooya"), + "String comparison (unequal lengths)."), + etap:is(true, couch_util:verify(<<"ahBase3r">>, <<"ahBase3r">>), + "Binary comparison."), + etap:is(false, couch_util:verify(<<"ahBase3rX">>, <<"ahBase3r">>), + "Binary comparison (unequal lengths)."), + etap:is(false, couch_util:verify(nil, <<"ahBase3r">>), + "Binary comparison with atom."), + ok. |