[Pkg-javascript-commits] [node-stream-splicer] 46/71: failing test for nested group after a stream
Bastien Roucariès
rouca at moszumanska.debian.org
Fri Dec 15 09:55:51 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 cee0b80e3f8e576629c88ddfe3ee4d279a14ed30
Author: James Halliday <mail at substack.net>
Date: Thu Jun 12 17:56:49 2014 -0700
failing test for nested group after a stream
---
test/nested_middle.js | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/test/nested_middle.js b/test/nested_middle.js
new file mode 100644
index 0000000..b9d737c
--- /dev/null
+++ b/test/nested_middle.js
@@ -0,0 +1,41 @@
+var pipeline = require('../');
+var through = require('through2');
+var stringify = require('JSONStream').stringify;
+var split = require('split');
+var concat = require('concat-stream');
+var test = require('tape');
+
+test('nested splicer', function (t) {
+ t.plan(1);
+
+ var addNewLines = through(function (buf, enc, next) {
+ this.push(buf + '\n');
+ next();
+ });
+
+ var stream = pipeline.obj([
+ through(function (buf, enc, next) {
+ this.push(String.fromCharCode(buf.charAt(0) + 5));
+ next();
+ }),
+ [ split(), addNewLines ],
+ through(function (buf, enc, next) {
+ this.push('> ' + buf);
+ next()
+ })
+ ]);
+
+ stream.get(0).unshift(through(function (buf, enc, next) {
+ this.push(buf.toString('utf8').toUpperCase());
+ next();
+ }));
+
+ stream.pipe(concat(function (body) {
+ t.deepEqual(body.toString(), '> F\n> G\n> H\n');
+ }));
+
+ stream.write('a\n');
+ stream.write('b\n');
+ stream.write('c');
+ stream.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