Skip to content

Commit

Permalink
Merge pull request #12714 from keymanapp/test/common/web/types/9052-u…
Browse files Browse the repository at this point in the history
…nit-tests-unicodeset-parser-api

test(common/web/types): unit tests for unicodeset-parser-api
  • Loading branch information
markcsinclair authored Nov 29, 2024
2 parents 80f0ec7 + eccc7ed commit 9c84816
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Keyman is copyright (C) SIL Global. MIT License.
*
* Created by Dr Mark C. Sinclair on 2024-11-29
*
* Test code for unicodeset-parser-api.ts
*/

import 'mocha';
import { assert } from 'chai';
import { UnicodeSet } from '../../src/ldml-keyboard/unicodeset-parser-api.js';

describe('Test of Unicode-Parser-API', () => {
describe('Test UnicodeSet', () => {
it('can provide a correct ranges length', () => {
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 UnicodeSet("[ħa-z]", [[0x41, 0x7A], [0x0127, 0x0127]]);
assert.deepEqual(unicodeSet.toString(), "[ħa-z]");
});
});
});

0 comments on commit 9c84816

Please sign in to comment.