Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(common/web/types): unit tests for unicodeset-parser-api #12714

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]");
});
});
});