Skip to content

Commit

Permalink
fix: unit tests were using strict equality testing for numeric result…
Browse files Browse the repository at this point in the history
…s. Modified to check for 15 decimals of precision. Now the exp unit test passes.
  • Loading branch information
BBI-YggyKing committed Oct 16, 2014
1 parent 6539211 commit 38c5766
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/generators/unittest_javascript.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ Blockly.JavaScript['unittest_main'].defineAssert_ = function(block) {
' function equals(a, b) {',
' if (a === b) {',
' return true;',
' } else if ((typeof a == "number") && (typeof b == "number") && (a.toPrecision(15) == b.toPrecision(15))) {',
' return true;',
' } else if (a instanceof Array && b instanceof Array) {',
' if (a.length != b.length) {',
' return false;',
Expand Down

0 comments on commit 38c5766

Please # to comment.