1
0
mirror of https://github.com/MikeMcl/decimal.js.git synced 2024-10-27 20:34:12 +00:00

Add newline to single test results

This commit is contained in:
Michael Mclaughlin 2016-03-09 22:54:34 +00:00
parent 6ec2449a07
commit ff621c1e35
3 changed files with 7 additions and 7 deletions

View File

@ -5,14 +5,14 @@ T = (function () {
function T(name, tests) { function T(name, tests) {
var time; var time;
write('\n Testing ' + name + '...'); write(' Testing ' + name + '...');
passed = testNumber = 0; passed = testNumber = 0;
time = new Date(); time = new Date();
tests(); tests();
time = new Date() - time; time = new Date() - time;
T.result = [passed, testNumber, time]; T.result = [passed, testNumber, time];
if (passed !== testNumber) write('\n'); if (passed !== testNumber) write('\n');
write(' ' + passed + ' of ' + testNumber + ' tests passed in ' + time + ' ms'); write(' ' + passed + ' of ' + testNumber + ' tests passed in ' + time + ' ms\n');
} }
if (typeof window != 'undefined') { if (typeof window != 'undefined') {

View File

@ -84,7 +84,7 @@
if (!module) { if (!module) {
time = new Date() - time; time = new Date() - time;
document.body.innerHTML += document.body.innerHTML +=
'<br><br>&nbsp;In total, ' + passed + ' of ' + total + ' tests passed in ' + (time / 1e3) + ' secs.<br>'; '<br>&nbsp;In total, ' + passed + ' of ' + total + ' tests passed in ' + (time / 1e3) + ' secs.<br>';
document.body.scrollIntoView(false); document.body.scrollIntoView(false);
return; return;
} }
@ -105,7 +105,7 @@
head.appendChild(script); head.appendChild(script);
} }
document.body.innerHTML += '&nbsp;Testing decimal.js<br>'; document.body.innerHTML += '&nbsp;Testing decimal.js<br><br>';
load(); load();
</script> </script>
</body> </body>

View File

@ -2,7 +2,7 @@ var time = new Date(),
passed = 0, passed = 0,
total = 0; total = 0;
console.log('\n Testing decimal.js'); console.log('\n Testing decimal.js\n');
[ [
'abs', 'abs',
@ -63,7 +63,7 @@ console.log('\n Testing decimal.js');
'toSD', 'toSD',
'toString', 'toString',
'trunc', 'trunc',
'valueOf', 'valueOf'
] ]
.forEach(function (module) { .forEach(function (module) {
require('./modules/' + module); require('./modules/' + module);
@ -72,4 +72,4 @@ console.log('\n Testing decimal.js');
}); });
time = new Date() - time; time = new Date() - time;
console.log('\n\n In total, ' + passed + ' of ' + total + ' tests passed in ' + (time / 1e3) + ' secs.\n'); console.log('\n In total, ' + passed + ' of ' + total + ' tests passed in ' + (time / 1e3) + ' secs.\n');