2016-01-18 08:09:56 +00:00
|
|
|
/**
|
|
|
|
* validate_test.js
|
|
|
|
*
|
2016-01-19 04:20:14 +00:00
|
|
|
* Run validate on all four main index files
|
2016-01-18 08:09:56 +00:00
|
|
|
*
|
|
|
|
* Copyright (c) 2012-2016 mooster@42at.com
|
|
|
|
* https://github.com/moos/wordpos
|
|
|
|
*
|
|
|
|
* Released under MIT license
|
|
|
|
*/
|
|
|
|
|
|
|
|
var
|
|
|
|
chai = require('chai'),
|
|
|
|
assert = chai.assert,
|
|
|
|
exec = require('child_process').exec,
|
|
|
|
cmd = 'node ' + __dirname + '/../tools/validate ',
|
2016-12-25 18:00:19 +00:00
|
|
|
TIMEOUT_SEC = 35 * 1000,
|
2016-01-18 08:09:56 +00:00
|
|
|
gDone;
|
|
|
|
|
|
|
|
|
|
|
|
describe('validate isX() using fastIndex', function() {
|
|
|
|
|
|
|
|
this.timeout(TIMEOUT_SEC);
|
2016-12-25 18:00:19 +00:00
|
|
|
this.slow(1800);
|
2016-01-18 08:09:56 +00:00
|
|
|
|
|
|
|
it('should validate index.verb', function(done) {
|
|
|
|
gDone = done;
|
|
|
|
exec(cmd + 'index.verb', callback);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should validate index.adv', function(done) {
|
|
|
|
gDone = done;
|
|
|
|
exec(cmd + 'index.adv', callback);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should validate index.adj', function(done) {
|
|
|
|
gDone = done;
|
|
|
|
exec(cmd + 'index.adj', callback);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should validate index.noun', function(done) {
|
|
|
|
gDone = done;
|
|
|
|
exec(cmd + 'index.noun', callback);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
function callback(error, stdout, stderr) {
|
|
|
|
assert.isNull(error);
|
|
|
|
console.log(stdout);
|
|
|
|
console.error(stderr);
|
|
|
|
gDone();
|
|
|
|
}
|