Skip to content

Commit f46d8d2

Browse files
committed
Merge pull request d3#1657 from DanGoldbach/polygon-area-test-epsilon
Use `inDelta` not `equals` for double comparisons in polygon area test
2 parents 4e9cbcb + 97d9cb3 commit f46d8d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/geo/area-test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ suite.addBatch({
4747
assert.inDelta(area({type: "Polygon", coordinates: [[[0, 0], [0, 90], [90, 0], [0, 0]]]}), π / 2, 1e-6);
4848
},
4949
"lune": function(area) {
50-
assert.equal(area({type: "Polygon", coordinates: [[[0, 0], [0, 90], [90, 0], [0, -90], [0, 0]]]}), π);
50+
assert.inDelta(area({type: "Polygon", coordinates: [[[0, 0], [0, 90], [90, 0], [0, -90], [0, 0]]]}), π, 1e-6);
5151
},
5252
"hemispheres": {
5353
"North": function(area) {
@@ -57,10 +57,10 @@ suite.addBatch({
5757
assert.inDelta(area({type: "Polygon", coordinates: [[[0, 0], [90, 0], [180, 0], [-90, 0], [0, 0]]]}), 2 * π, 1e-6);
5858
},
5959
"East": function(area) {
60-
assert.equal(area({type: "Polygon", coordinates: [[[0, 0], [0, 90], [180, 0], [0, -90], [0, 0]]]}), 2 * π);
60+
assert.inDelta(area({type: "Polygon", coordinates: [[[0, 0], [0, 90], [180, 0], [0, -90], [0, 0]]]}), 2 * π, 1e-6);
6161
},
6262
"West": function(area) {
63-
assert.equal(area({type: "Polygon", coordinates: [[[0, 0], [0, -90], [180, 0], [0, 90], [0, 0]]]}), 2 * π);
63+
assert.inDelta(area({type: "Polygon", coordinates: [[[0, 0], [0, -90], [180, 0], [0, 90], [0, 0]]]}), 2 * π, 1e-6);
6464
}
6565
},
6666
"graticule outline": {

0 commit comments

Comments
 (0)