Commit 38c57662 authored by yggy's avatar yggy

fix: unit tests were using strict equality testing for numeric results....

fix: unit tests were using strict equality testing for numeric results. Modified to check for 15 decimals of precision. Now the exp unit test passes.
parent 65392111
......@@ -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;',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment