Skip to content

Commit 81243cd

Browse files
committed
Add tests for NaN, Infinity and negative width/height
1 parent a842712 commit 81243cd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/map.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ test('should throw with invalid usage', (assert) => {
2121
assert.throws(function() { new mapnik.Map('foo'); });
2222
assert.throws(function() { new mapnik.Map('a', 'b', 'c'); });
2323
assert.throws(function() { new mapnik.Map(new mapnik.Map(1, 1)); });
24+
assert.throws(function() { new mapnik.Map(0, 1);});
25+
assert.throws(function() { new mapnik.Map(1, 0);});
26+
assert.throws(function() { new mapnik.Map(-1, 1);});
27+
assert.throws(function() { new mapnik.Map(1, -1);});
28+
assert.throws(function() { new mapnik.Map(NaN, 1);});
29+
assert.throws(function() { new mapnik.Map(1, NaN);});
30+
assert.throws(function() { new mapnik.Map(Infinity, 1);});
31+
assert.throws(function() { new mapnik.Map(1, Infinity);});
2432
assert.end();
2533
});
2634

0 commit comments

Comments
 (0)