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.

29 lines
546 B

  1. /*
  2. sometimes jsonparse changes numbers slightly.
  3. */
  4. var r = Math.random()
  5. , Parser = require('jsonparse')
  6. , p = new Parser()
  7. , assert = require('assert')
  8. , times = 20
  9. , bufferFrom = Buffer.from && Buffer.from !== Uint8Array.from
  10. , str
  11. while (times --) {
  12. assert.equal(JSON.parse(JSON.stringify(r)), r, 'core JSON')
  13. p.onValue = function (v) {
  14. console.error('parsed', v)
  15. assert.equal(v,r)
  16. }
  17. console.error('correct', r)
  18. str = JSON.stringify([r])
  19. p.write (bufferFrom ? Buffer.from(str) : new Buffer(str))
  20. }