nodeschool / discussions

:school::speech_balloon: need help with nodeschool? or just wanna ask a question? open an issue on this repo!
488 stars 107 forks source link

stream-adventure HTML Stream validation fails #17

Closed wileym closed 9 years ago

wileym commented 11 years ago

Running my version seemed to be producing valid results when using 'stream-adventure run'. When switching to 'stream-adventure verify' it reports an incorrect result, but all the expected result lines are null.

To check, I copied stream-adventure/problems/html_stream/solution.js, tried verify again, and had the same result.

I'm running Win7, node 0.10.18

rvagg commented 11 years ago

@substack any ideas on this? works for me and I haven't seen any similar reports.

singularperturbation commented 11 years ago

Could it be the difference between Unix/Windows EOL characters? That's just a guess. I'm working through 'learnyounode' at the moment, but when I get to stream-adventure I have access to a Windows computer with node and can play around a bit.

loic-moriame commented 10 years ago

I have also this error... stream-adventure.cmd run html_stream.js seems to be good stream-adventure.cmd verify html_stream.js failed

I'm running on Win7 / Node 0.10.5

My html_stream.js is below :

(function() {
  'use strict';

  var trumpet = require('trumpet'),
      through = require('through');

  var tr      = trumpet();
  var stream  = tr.select('.loud').createStream();

  stream.pipe(through(function write(buffer) {
    this.queue(buffer.toString().toUpperCase());
  })).pipe(stream);

  process.stdin.pipe(tr).pipe(process.stdout);

})();
Sequoia commented 9 years ago

@moriame @wileym please reopen if this issue persists! :+1:

andrewmnelson commented 9 years ago

I had this issue as well, running stream-adventure on Windows 7 x64, and discovered that by making the 'through' callback = function(buf, _notUsed, next) { this.push(buf.toString().toUpperCase()); next(); } the .loud text got uppercased, and the following text was also streamed. Why this is different on Windows, I have no idea, but this is exactly why I'm a believer in genetic diversity among devs :-)