Skip to content

Commit

Permalink
Ensure chaining & fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
parkr committed Jan 20, 2015
1 parent 9fcb30d commit 77ffecc
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/unit_tests.js
Expand Up @@ -104,10 +104,18 @@ describe('SHA3', function(){

it('incorporates the updates into the output', function(){
var sha = new SHA3(224);
sha.digest('hex');
// assert.equal("blah", sha.digest('hex'));
// sha.update('some value');
// assert.equal("blah2", sha.digest('hex'));
assert.equal('f71837502ba8e10837bdd8d365adb85591895602fc552b48b7390abd', sha.digest('hex'));
sha.update('some value');
assert.equal('c6e8a28b9c677c4f5a1098cbc07454cdf7ba7dc4ee600a4655bec0a6', sha.digest('hex'));
});
});

describe('chaining', function(){
it('can chain', function(){
assert.equal(
'76a781712088f94b4f6ca4962f886cac1158bc2f79eabade5ff76d14',
SHA3(224).update('vlad').digest('hex')
);
})
});
});

0 comments on commit 77ffecc

Please sign in to comment.