forked from sheetjs/sheetjs
SheetJS
c299585bfb
- Updated frac to 0.3.1 (issue with numbers exceeding 2**32) - Invalid dates render empty string - Sub-second string format - First steps towards Engineering format - Fraction formats don't render blanks in the case of zero - Trailing spaces removed - More implied tests
16 lines
540 B
JavaScript
16 lines
540 B
JavaScript
var SSF = require('../');
|
|
var fs = require('fs'), assert = require('assert');
|
|
var data = JSON.parse(fs.readFileSync('./test/implied.json','utf8'));
|
|
var skip = [];
|
|
function doit(d) {
|
|
d[1].forEach(function(r){if(!r[2])assert.equal(SSF.format(r[0],d[0]),r[1]);});
|
|
}
|
|
describe('implied formats', function() {
|
|
data.forEach(function(d) {
|
|
if(d.length == 2) it(d[0], function() { doit(d); });
|
|
else it(d[1]+" for "+d[0], skip.indexOf(d[1]) > -1 ? null : function(){
|
|
assert.equal(SSF.format(d[1], d[0], {}), d[2]);
|
|
});
|
|
});
|
|
});
|