mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-04 14:47:42 +00:00
change(web): clean ContextState unit tests
Addresses these comments: - https://github.com/keymanapp/keyman/issues/15265#issuecomment-3636890802 - https://github.com/keymanapp/keyman/issues/15265#issuecomment-3636901217 Build-bot: skip build:web Test-bot: skip
This commit is contained in:
parent
e02404b365
commit
370928c8e5
1 changed files with 1 additions and 17 deletions
|
|
@ -98,14 +98,6 @@ describe('ContextState', () => {
|
|||
let newContextMatch = baseState.analyzeTransition(newContext, toWrapperDistribution(transform));
|
||||
assert.isNotNull(newContextMatch?.final);
|
||||
assert.deepEqual(newContextMatch.final.tokenization.tokens.map(token => token.exampleInput), rawTokens);
|
||||
|
||||
// // Phrased this way to facilitate TS type-inference; assert.isTrue() does
|
||||
// // NOT do this for us!
|
||||
// if(!newContextMatch.final.tokenization.alignment.canAlign) {
|
||||
// assert.fail("context alignment failed");
|
||||
// }
|
||||
// assert.equal(newContextMatch.final.tokenization.alignment.leadTokenShift, 0);
|
||||
// assert.equal(newContextMatch.final.tokenization.alignment.tailTokenShift, 0);
|
||||
});
|
||||
|
||||
it("properly matches and aligns when no context changes occur (after whitespace)", function() {
|
||||
|
|
@ -125,14 +117,6 @@ describe('ContextState', () => {
|
|||
let newContextMatch = baseState.analyzeTransition(newContext, toWrapperDistribution(transform));
|
||||
assert.isNotNull(newContextMatch?.final);
|
||||
assert.deepEqual(newContextMatch.final.tokenization.tokens.map(token => token.exampleInput), rawTokens);
|
||||
|
||||
// // Phrased this way to facilitate TS type-inference; assert.isTrue() does
|
||||
// // NOT do this for us!
|
||||
// if(!newContextMatch.final.tokenization.alignment.canAlign) {
|
||||
// assert.fail("context alignment failed");
|
||||
// }
|
||||
// assert.equal(newContextMatch.final.tokenization.alignment.leadTokenShift, 0);
|
||||
// assert.equal(newContextMatch.final.tokenization.alignment.tailTokenShift, 0);
|
||||
});
|
||||
|
||||
it("properly matches and aligns when lead token is removed (end of word)", function() {
|
||||
|
|
@ -437,7 +421,7 @@ describe('ContextState', () => {
|
|||
});
|
||||
});
|
||||
|
||||
describe('determineContextSlideDeltas', () => {
|
||||
describe('determineContextSlideTransform', () => {
|
||||
it('finds prefixed text for backward sliding context window', () => {
|
||||
const before: Context = {
|
||||
left: 'ples and bananas',
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue