Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
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.

47 lines
1.1 KiB

  1. var fs = require ('fs')
  2. , join = require('path').join
  3. , file = join(__dirname, 'fixtures','all_npm.json')
  4. , JSONStream = require('../')
  5. , it = require('it-is').style('colour')
  6. , es = require('event-stream')
  7. , pending = 10
  8. , passed = true
  9. function randomObj () {
  10. return (
  11. Math.random () < 0.4
  12. ? {hello: 'eonuhckmqjk',
  13. whatever: 236515,
  14. lies: true,
  15. nothing: [null],
  16. stuff: [Math.random(),Math.random(),Math.random()]
  17. }
  18. : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]]
  19. )
  20. }
  21. for (var ix = 0; ix < pending; ix++) (function (count) {
  22. var expected = {}
  23. , stringify = JSONStream.stringifyObject()
  24. es.connect(
  25. stringify,
  26. es.writeArray(function (err, lines) {
  27. it(JSON.parse(lines.join(''))).deepEqual(expected)
  28. if (--pending === 0) {
  29. console.error('PASSED')
  30. }
  31. })
  32. )
  33. while (count --) {
  34. var key = Math.random().toString(16).slice(2)
  35. expected[key] = randomObj()
  36. stringify.write([ key, expected[key] ])
  37. }
  38. process.nextTick(function () {
  39. stringify.end()
  40. })
  41. })(ix)