Software zum Installieren eines Smart-Mirror Frameworks , zum Nutzen von hochschulrelevanten Informationen, auf einem Raspberry-Pi.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

options.asynct.js 851B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. var it = require('it-is').style('colour')
  2. , split = require('..')
  3. exports ['maximum buffer limit'] = function (test) {
  4. var s = split(JSON.parse, null, {
  5. maxLength: 2
  6. })
  7. , caughtError = false
  8. , rows = []
  9. s.on('error', function (err) {
  10. caughtError = true
  11. })
  12. s.on('data', function (row) { rows.push(row) })
  13. s.write('{"a":1}\n{"')
  14. s.write('{ "')
  15. it(caughtError).equal(true)
  16. s.end()
  17. test.done()
  18. }
  19. exports ['ignore trailing buffers'] = function (test) {
  20. var s = split(JSON.parse, null, {
  21. trailing: false
  22. })
  23. , caughtError = false
  24. , rows = []
  25. s.on('error', function (err) {
  26. caughtError = true
  27. })
  28. s.on('data', function (row) { rows.push(row) })
  29. s.write('{"a":1}\n{"')
  30. s.write('{ "')
  31. s.end()
  32. it(caughtError).equal(false)
  33. it(rows).deepEqual([ { a: 1 } ])
  34. test.done()
  35. }