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.

22 lines
444 B

  1. var traverse = require('./');
  2. var test = require('testling');
  3. test('leaves', function (t) {
  4. var obj = {
  5. a : [1,2,3],
  6. b : 4,
  7. c : [5,6],
  8. d : { e : [7,8], f : 9 }
  9. };
  10. var acc = [];
  11. traverse(obj).forEach(function (x) {
  12. if (this.isLeaf) acc.push(x);
  13. });
  14. t.deepEqual(
  15. acc, [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ],
  16. 'traversal in the proper order'
  17. );
  18. t.end();
  19. });