Skip to content

Commit 1ec7a95

Browse files
committed
jsnums-test.js: Add test for toRepeatingDecimal() mistakenly called with
errbacks as 3rd (rather than 4th) arg
1 parent d3d00ad commit 1ec7a95

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/jsnums-test/jsnums-test.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ R(["pyret-base/js/js-numbers"], function(JN) {
375375
JN.toRepeatingDecimal(10, JN.makeRational(113, 355), undefined, sampleErrbacks);
376376
}).toThrowError(/not an integer/);
377377

378+
// errbacks given as 3rd rather than 4th arg, as happened once on cpo
379+
expect(function() {
380+
JN.toRepeatingDecimal(355/133, 10, sampleErrbacks);
381+
}).toThrowError(/undefined/);
382+
378383
// toStringDigits
379384
expect(JN.toStringDigits(123456789, 5, sampleErrbacks))
380385
.toBe("123456789.00000");

0 commit comments

Comments
 (0)