source: trip-planner-front/node_modules/uniqs/test.js@ fa375fe

Last change on this file since fa375fe was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 584 bytes
Line 
1var uniqs = require('./');
2var util = require('util');
3var assert = require('assert');
4
5var foo = { foo: 23 };
6
7[
8 [ [[2, 1, 1], [2, 3, 3, 4], [4, 3, 2]], [2, 1, 3, 4] ],
9 [ [3, 2, 2, [1, 1, 2]], [3, 2, 1] ],
10 [ [[2, 2, 3, "a", 3, 1, foo, foo, "a" ]], [ 2, 3, "a", 1, foo ] ],
11 [ [23], [23] ],
12 [ [], [] ],
13 [ [[]], [] ],
14 [ [[null], null], [null] ]
15]
16.forEach(function(t) {
17 var args = t[0].map(JSON.stringify);
18 assert.deepEqual(uniqs.apply(this, t[0]), t[1],
19 util.format('✘ uniqs(%s) !== %j', args, t[1])
20 );
21 console.log('✔ uniqs(%s) == %j', args, t[1]);
22});
Note: See TracBrowser for help on using the repository browser.