fix tests

This commit is contained in:
moos 2020-12-08 20:01:29 -08:00
parent 280bf22ad8
commit 51c412e82e
3 changed files with 6 additions and 7 deletions

View File

@ -224,13 +224,13 @@ function getPOS(text, callback) {
var args = [data]; var args = [data];
var matches = uniq(flat(Object.values(data))); var matches = uniq(flat(Object.values(data)));
data.rest = diff(words, matches); data.rest = diff(words, matches);
profile && args.push(new Date() - start); profile && args.push(new Date() - start);
nextTick(callback, args); nextTick(callback, args);
return data; return data;
} }
function error(err) { function error(err) {
console.log('Error >>> ', err);
nextTick(callback, []); nextTick(callback, []);
throw err; throw err;
} }

View File

@ -62,11 +62,10 @@ describe('CLI tests', function() {
it('should get POS', done => { it('should get POS', done => {
exec(cmd + '-b get ' + testStr, (error, stdout, stderr) => { exec(cmd + '-b get ' + testStr, (error, stdout, stderr) => {
assert.isNull(error); assert.isNull(error);
assert.equal(stdout.trim(), cmp(stdout, 'bear chased squirrel little \n' +
'bear chased little squirrel \n' + 'angry frightened little \n' +
'angry frightened little \n' + 'bear \n' +
'bear \n' + 'little');
'little');
done(); done();
}); });
}); });

View File

@ -56,7 +56,7 @@ var str = "The angry bear chased the frightened little squirrel",
verbs: [ 'bear' ], verbs: [ 'bear' ],
adjectives: [ 'little', 'angry', 'frightened' ], adjectives: [ 'little', 'angry', 'frightened' ],
adverbs: [ 'little' ], adverbs: [ 'little' ],
rest: [ 'The' ] rest: []
}, },
garble = 'garblegarble', // expect not to find word garble = 'garblegarble', // expect not to find word
offset = 1285602; offset = 1285602;