[Pkg-javascript-commits] [node-sha.js] 126/237: also test with 3 partial updates
Bastien Roucariès
rouca at moszumanska.debian.org
Fri May 5 09:03:46 UTC 2017
This is an automated email from the git hooks/post-receive script.
rouca pushed a commit to branch master
in repository node-sha.js.
commit 37981e0b751e4cbb0631472aa19f5facb220cc31
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date: Thu Jul 24 03:30:26 2014 -0700
also test with 3 partial updates
---
test/vectors.js | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/test/vectors.js b/test/vectors.js
index 52b92b6..d61d8c7 100644
--- a/test/vectors.js
+++ b/test/vectors.js
@@ -36,6 +36,23 @@ function makeTest(alg, i, verbose) {
v[alg]
)
+ var j, buf3
+
+ i = ~~(buf.length / 3)
+ j = ~~(buf.length * 2 / 3)
+ buf1 = buf.slice(0, i)
+ buf2 = buf.slice(i, j)
+ buf3 = buf.slice(j, buf.length)
+
+ t.equal(
+ createHash(alg)
+ .update(buf1)
+ .update(buf2)
+ .update(buf3)
+ .digest('hex'),
+ v[alg]
+ )
+
setTimeout(function () {
//avoid "too much recursion" errors in tape in firefox
t.end()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-sha.js.git
More information about the Pkg-javascript-commits
mailing list