Skip to content

Commit f48aeff

Browse files
committed
add some tests for cairo limits
1 parent 18d8449 commit f48aeff

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎test/canvas.test.js‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ describe('Canvas', function () {
3636
assert('width' in Canvas.prototype)
3737
})
3838

39+
it('limits createCanvas size via exceptions', function () {
40+
assert.throws(() => createCanvas(40_000, 100))
41+
assert.throws(() => createCanvas(4000, 40_000))
42+
assert.throws(() => createCanvas(40_000, 40_000))
43+
})
44+
3945
it('registerFont', function () {
4046
// Minimal test to make sure nothing is thrown
4147
registerFont('./examples/pfennigFont/Pfennig.ttf', { family: 'Pfennig' })

0 commit comments

Comments
 (0)