Permalink
Browse files

issue #34: test case

  • Loading branch information...
1 parent baa8b6a commit e5e544689803d9177281dedc37cc9e3fc0ce458e @trentm committed Jul 31, 2012
Showing with 29 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +11 −0 test/docstream.js
  3. +3 −0 test/stream/README.md
  4. +7 −0 test/stream/cmd
  5. +6 −0 test/stream/expected.stdout
  6. +1 −0 test/stream/input
View
@@ -1,2 +1,3 @@
/tmp
/node_modules
+/test/stream/stream.log
View
@@ -0,0 +1,11 @@
+
+var sentinel = Number(process.argv[2]);
+if (isNaN(sentinel))
+ sentinel = 5;
+var interval = setInterval(function () {
+ sentinel--;
+ if (sentinel <= 0) {
+ clearInterval(interval);
+ }
+ console.log(JSON.stringify({foo: "bar"}))
+}, 1000);
View
@@ -0,0 +1,3 @@
+Want this to stream output:
+
+ <stream-of-json-docs> | json -ga
View
@@ -0,0 +1,7 @@
+JSON=../../lib/jsontool.js
+
+node ../docstream.js 3 | $JSON -ga >stream.log &
+#node ../docstream.js 3 >stream.log &
+sleep 2.5
+cat stream.log
+
@@ -0,0 +1,6 @@
+{
+ "foo": "bar"
+}
+{
+ "foo": "bar"
+}
View
@@ -0,0 +1 @@
+{"foo": "bar"}

0 comments on commit e5e5446

Please sign in to comment.