[Pkg-javascript-commits] [node-sha.js] 57/237: refactor tests, for createHash

Bastien Roucariès rouca at moszumanska.debian.org
Fri May 5 09:02:55 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 f4241979e140b8317abeb84773136e92d8811ca6
Author: Dominic Tarr <dominic.tarr at gmail.com>
Date:   Fri Dec 27 21:24:54 2013 +0700

    refactor tests, for createHash
---
 test/enc.js     |  2 +-
 test/test.js    |  2 +-
 test/vectors.js | 11 +----------
 3 files changed, 3 insertions(+), 12 deletions(-)

diff --git a/test/enc.js b/test/enc.js
index ab4e261..20f132b 100644
--- a/test/enc.js
+++ b/test/enc.js
@@ -1,4 +1,4 @@
-var Sha1 = require('../')
+var Sha1 = require('../sha1')
 var tape = require('tape')
 var toString = require('../util').toString
 var toBuffer = require('bops/typedarray/from')
diff --git a/test/test.js b/test/test.js
index 703e697..49cffae 100644
--- a/test/test.js
+++ b/test/test.js
@@ -1,7 +1,7 @@
 
 var crypto = require('crypto')
 var tape   = require('tape')
-var Sha1   = require('../')
+var Sha1   = require('../sha1')
 var Uint32toHex = Sha1.Uint32toHex
 var u = require('../util')
 
diff --git a/test/vectors.js b/test/vectors.js
index 364b60c..c991a7b 100644
--- a/test/vectors.js
+++ b/test/vectors.js
@@ -4,16 +4,7 @@ var tape = require('tape')
 var from = require('bops/typedarray/from')
 var hexpp = require('../hexpp')
 
-var Sha1 = require('../')
-var Sha256 = require('../sha256')
-
-function createHash(alg) {
-  return (
-      'sha1'   == alg ? new Sha1()
-    : 'sha256' == alg ? new Sha256()
-    : (function () { throw new Error(alg + ' is not supported') }) ()
-  )
-}
+var createHash = require('../')
 
 function makeTest(alg, i, verbose) {
   var v = vectors[i]

-- 
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