mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-17 03:17:33 +00:00
feat(web): add non-BMP test for edge-window-slide suite
This commit is contained in:
parent
cf017acb1c
commit
10ccc954ef
1 changed files with 11 additions and 0 deletions
|
|
@ -868,6 +868,17 @@ describe('ContextTokenization', function() {
|
|||
assert.isTrue(resultTokenization.tokens[0].isPartial);
|
||||
});
|
||||
|
||||
it('preserves tokenization patterns when word slides partially out of window - SMP strings', () => {
|
||||
const baseTokens = ['apples', ' ', 'and', ' ', 'bananas'].map(s => toMathematicalSMP(s));
|
||||
const baseTokenization = new ContextTokenization(baseTokens.map(t => toToken(t)), null);
|
||||
|
||||
const resultTokenization = baseTokenization.applyContextSlide(plainModel, { insert: '', deleteLeft: 0, deleteRight: 2});
|
||||
|
||||
assert.notStrictEqual(resultTokenization, baseTokenization);
|
||||
assert.deepEqual(resultTokenization.exampleInput, ['ples', ' ', 'and', ' ', 'bananas'].map(s => toMathematicalSMP(s)));
|
||||
assert.isTrue(resultTokenization.tokens[0].isPartial);
|
||||
});
|
||||
|
||||
it('does not preserve deleted tokens', () => {
|
||||
const baseTokens = ['apples', ' ', 'and', ' ', 'bananas'];
|
||||
const baseTokenization = new ContextTokenization(baseTokens.map(t => toToken(t)), null);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue