1 | var uniqs = require('./');
|
2 | var util = require('util');
|
3 | var assert = require('assert');
|
4 |
|
5 | var 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 | });
|