-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmerge-test.js
More file actions
27 lines (23 loc) · 717 Bytes
/
Copy pathmerge-test.js
File metadata and controls
27 lines (23 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require("../env");
require("../../d3");
var vows = require("vows"),
assert = require("assert");
var suite = vows.describe("d3.merge");
suite.addBatch({
"merge": {
"merges an array of arrays": function() {
var a = {}, b = {}, c = {}, d = {}, e = {}, f = {};
assert.deepEqual(d3.merge([[a], [b, c], [d, e, f]]), [a, b, c, d, e, f]);
},
"returns a new array": function() {
var input = [[1, 2, 3], [4, 5], [6]];
assert.isFalse(d3.merge(input) === input);
},
"does not modify the input arrays": function() {
var input = [[1, 2, 3], [4, 5], [6]];
d3.merge(input);
assert.deepEqual(input, [[1, 2, 3], [4, 5], [6]]);
}
}
});
suite.export(module);