From 1c529da03e3b246521cd64714f2d9379e96bf691 Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Wed, 12 Dec 2012 21:22:54 -0800 Subject: [PATCH] Silence bogus test failures. --- src/geo/path.js | 5 ++++- test/geo/path-test.js | 32 ++++++++++++++++++-------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/src/geo/path.js b/src/geo/path.js index cde62c13..1bb93c77 100644 --- a/src/geo/path.js +++ b/src/geo/path.js @@ -1,4 +1,7 @@ -// TODO fallback for projections that don't implement point, polygon? (or fix albersUsa?) +// TODO fallback for projections that don't implement stream? (or fix albersUsa?) +// TODO cache pathBuffer / pathContext across invocations? +// TODO better encapsulation for d3_geo_pathArea; move to area.js +// TODO better encapsulation for d3_geo_pathCentroid; move to centroid.js d3.geo.path = function() { var pointRadius = 4.5, diff --git a/test/geo/path-test.js b/test/geo/path-test.js index 867e0c80..42b58edb 100644 --- a/test/geo/path-test.js +++ b/test/geo/path-test.js @@ -89,20 +89,24 @@ suite.addBatch({ ]); }, - "returns null when passed null or undefined": function(path) { - assert.isNull(path(null)); - assert.isNull(path(undefined)); - assert.isNull(path()); - }, - - "bogus type name": function(path) { - assert.isNull(path({ - type: "Feature", - geometry: { - type: "__proto__", - coordinates: [[[-63.03, 18.02], [-63.14, 18.06], [-63.01, 18.07], [-63.03, 18.02]]] - }, - })); + "with no context": { + topic: function(path) { + return d3.geo.path().projection(path.projection()); + }, + "returns null when passed null or undefined": function(path) { + assert.equal(path(null), null); + assert.equal(path(undefined), null); + assert.equal(path(), null); + }, + "returns null with bogus type name": function(path) { + assert.equal(path({ + type: "Feature", + geometry: { + type: "__proto__", + coordinates: [[[-63.03, 18.02], [-63.14, 18.06], [-63.01, 18.07], [-63.03, 18.02]]] + }, + }), null); + } }, "projection": {