[Pkg-javascript-commits] [node-randomfill] 22/47: add test for zero bytes

Bastien Roucariès rouca at moszumanska.debian.org
Fri Dec 15 09:52:52 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-randomfill.

commit 7d1d6258434b67e762086f593863023813f113e9
Author: Calvin Metcalf <cmetcalf at appgeo.com>
Date:   Wed Mar 2 13:20:09 2016 -0500

    add test for zero bytes
---
 test.js | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/test.js b/test.js
index 5507415..8e34dca 100644
--- a/test.js
+++ b/test.js
@@ -2,14 +2,21 @@ var test = require('tape')
 var randomBytes = require('./')
 
 test('sync', function (t) {
-  t.plan(3)
+  t.plan(4)
+  t.equals(randomBytes(0).length, 0, 'len: ' + 0)
   t.equals(randomBytes(3).length, 3, 'len: ' + 3)
   t.equals(randomBytes(30).length, 30, 'len: ' + 30)
   t.equals(randomBytes(300).length, 300, 'len: ' + 300)
 })
 
 test('async', function (t) {
-  t.plan(3)
+  t.plan(4)
+
+  randomBytes(0, function (err, resp) {
+    if (err) throw err
+
+    t.equals(resp.length, 0, 'len: ' + 0)
+  })
 
   randomBytes(3, function (err, resp) {
     if (err) throw err

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-randomfill.git



More information about the Pkg-javascript-commits mailing list