[Pkg-javascript-commits] [node-stream-splicer] 50/71: get tests
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:55: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-stream-splicer.
commit edd2a77157d6a3f6a244074a59579a2cfd9bb030
Author: James Halliday <mail at substack.net>
Date: Sat Jun 14 13:18:27 2014 -0700
get tests
---
test/get.js | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/test/get.js b/test/get.js
new file mode 100644
index 0000000..2eb4977
--- /dev/null
+++ b/test/get.js
@@ -0,0 +1,24 @@
+var pipeline = require('../');
+var through = require('through2');
+var test = require('tape');
+
+test('get', function (t) {
+ var a = through.obj();
+ var b = through.obj();
+ var c = through.obj();
+
+ var pipe = pipeline([ a, b, c ]);
+ t.equal(pipe.get(0), a, '0');
+ t.equal(pipe.get(1), b, '1');
+ t.equal(pipe.get(2), c, '2');
+ t.equal(pipe.get(3), undefined, '3');
+ t.equal(pipe.get(4), undefined, '4');
+ t.equal(pipe.get(5), undefined, '5');
+ t.equal(pipe.get(-1), c, '-1');
+ t.equal(pipe.get(-1), c, '-1');
+ t.equal(pipe.get(-2), b, '-2');
+ t.equal(pipe.get(-3), a, '-3');
+ t.equal(pipe.get(-4), undefined, '-4');
+ t.equal(pipe.get(-5), undefined, '-5');
+ t.end();
+});
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-stream-splicer.git
More information about the Pkg-javascript-commits
mailing list