Skip to content

Commit

Permalink
chore(common/web): remove MockUnicodeSet as unnecessary
Browse files Browse the repository at this point in the history
  • Loading branch information
markcsinclair committed Nov 29, 2024
1 parent a2cb00a commit 3de4f99
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Keyman is copyright (C) SIL Global. MIT License.
*
* Created by Dr Mark C. Sinclair on 2024-11-28
* Created by Dr Mark C. Sinclair on 2024-11-29
*
* Test code for unicodeset-parser-api.ts
*/
Expand All @@ -10,22 +10,14 @@ import 'mocha';
import { assert } from 'chai';
import { UnicodeSet } from '../../src/ldml-keyboard/unicodeset-parser-api.js';

class MockUnicodeSet extends UnicodeSet {
constructor(public pattern: string, public ranges: number[][]) {
super(pattern, ranges); // does nothing
this.pattern = pattern;
this.ranges = ranges;
}
}

describe('Test of Unicode-Parser-API', () => {
describe('Test UnicodeSet', () => {
it('can provide a correct ranges length', () => {
const unicodeSet = new MockUnicodeSet("[ħa-z]", [[0x41, 0x7A], [0x0127, 0x0127]]);
const unicodeSet = new UnicodeSet("[ħa-z]", [[0x41, 0x7A], [0x0127, 0x0127]]);
assert.equal(unicodeSet.length, 2);
});
it('can provide a correct string representation', () => {
const unicodeSet = new MockUnicodeSet("[ħa-z]", [[0x41, 0x7A], [0x0127, 0x0127]]);
const unicodeSet = new UnicodeSet("[ħa-z]", [[0x41, 0x7A], [0x0127, 0x0127]]);
assert.deepEqual(unicodeSet.toString(), "[ħa-z]");
});
});
Expand Down

0 comments on commit 3de4f99

Please sign in to comment.