mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-08 15:07:33 +00:00
Test integration of initialize() in LMLayer and Worker.
This commit is contained in:
parent
75f0fd41dc
commit
fe78283b92
1 changed files with 17 additions and 3 deletions
|
|
@ -2,10 +2,24 @@ var assert = chai.assert;
|
|||
|
||||
describe('LMLayer', function () {
|
||||
describe('[[constructor]]', function () {
|
||||
it('should construct with zero arguments', function () {
|
||||
let lmlayer = new LMLayer();
|
||||
assert.instanceOf(lmlayer, LMLayer);
|
||||
it('should construct with zero arguments', function () {
|
||||
let lmLayer = new LMLayer();
|
||||
assert.instanceOf(lmLayer, LMLayer);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#initialize()', function () {
|
||||
it('should yield a reasonable configuration', function () {
|
||||
let maxLeftContext = 64;
|
||||
let lmLayer = new LMLayer();
|
||||
return lmLayer.initialize(
|
||||
{ maxLeftContextCodeUnits: maxLeftContext },
|
||||
{ model: { kind: 'wordlist', words: ['foo', 'bar']} }
|
||||
).then(function (configuration) {
|
||||
assert.isAtMost(configuration.leftContextCodeUnits, maxLeftContext);
|
||||
assert.propertyVal(configuration, 'rightContextCodeUnits', 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#asBlobURI()', function () {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue