2013-12-26 22:35:42 +00:00
|
|
|
/* vim: set ts=2: */
|
2017-03-12 07:34:36 +00:00
|
|
|
/*jshint loopfunc:true, mocha:true, node:true */
|
2013-12-26 22:35:42 +00:00
|
|
|
var SSF = require('../');
|
|
|
|
var fs = require('fs'), assert = require('assert');
|
|
|
|
var data = JSON.parse(fs.readFileSync('./test/general.json','utf8'));
|
|
|
|
var skip = [];
|
|
|
|
describe('General format', function() {
|
|
|
|
data.forEach(function(d) {
|
|
|
|
it(d[1]+" for "+d[0], skip.indexOf(d[1]) > -1 ? null : function(){
|
|
|
|
assert.equal(SSF.format(d[1], d[0], {}), d[2]);
|
|
|
|
});
|
|
|
|
});
|
2017-04-30 04:54:41 +00:00
|
|
|
it('should handle special values', function() {
|
2017-03-12 07:34:36 +00:00
|
|
|
assert.equal(SSF.format("General", true), "TRUE");
|
|
|
|
assert.equal(SSF.format("General", undefined), "");
|
|
|
|
assert.equal(SSF.format("General", null), "");
|
2014-01-20 08:37:48 +00:00
|
|
|
});
|
2013-12-26 22:35:42 +00:00
|
|
|
});
|