Sha256: be5bafd5336dda7c51106e1ee0400bc560e3b9c7fc619b26f4efc154dfc8c3fc

Contents?: true

Size: 772 Bytes

Versions: 4

Compression:

Stored size: 772 Bytes

Contents

var vows = require("vows"),
    load = require("../load"),
    assert = require("../assert");

var suite = vows.describe("d3.merge");

suite.addBatch({
  "merge": {
    topic: load("arrays/merge").expression("d3.merge"),
    "merges an array of arrays": function(merge) {
      var a = {}, b = {}, c = {}, d = {}, e = {}, f = {};
      assert.deepEqual(merge([[a], [b, c], [d, e, f]]), [a, b, c, d, e, f]);
    },
    "returns a new array": function(merge) {
      var input = [[1, 2, 3], [4, 5], [6]];
      assert.isFalse(merge(input) === input);
    },
    "does not modify the input arrays": function(merge) {
      var input = [[1, 2, 3], [4, 5], [6]];
      merge(input);
      assert.deepEqual(input, [[1, 2, 3], [4, 5], [6]]);
    }
  }
});

suite.export(module);

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
stripchart-0.0.3 lib/stripchart/public/components/d3/test/arrays/merge-test.js
stripmem-0.0.3 lib/stripmem/public/components/d3/test/arrays/merge-test.js
stripmem-0.0.2 lib/stripmem/public/components/d3/test/arrays/merge-test.js
stripmem-0.0.1 lib/stripmem/public/components/d3/test/arrays/merge-test.js