Commit c31e8dc4 authored by Neil Fraser's avatar Neil Fraser

Merge pull request #2 from yoyoyvr/dev.unit-test-precision

fix: unit tests were using strict equality testing for numeric results; now check 15 decimals
parents d99a04a6 38c57662
......@@ -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