Skip to content

Commit

Permalink
chore(common/web): add two test cases for null key text and non-null …
Browse files Browse the repository at this point in the history
…key bitmap
  • Loading branch information
markcsinclair committed Dec 3, 2024
1 parent c0beb22 commit 47794cf
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions common/web/types/test/kvk/test-kvk-file-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,38 @@ describe('Test of KVK-File-Writer', () => {
// const binary: BUILDER_KVK_FILE = writer['build'](vk);
// checkBuilderKvkFile(binary, vk);
// });
it('can handle a null key text', () => {
const vk = initVisualKeyboard([
initVisualKeyboardKey(
0,
BUILDER_KVK_KEY_FLAGS.kvkkBitmap,
BUILDER_KVK_SHIFT_STATE.KVKS_NORMAL,
null,
null,
),
initVisualKeyboardKey(1),
initVisualKeyboardKey(2),
]);
const writer = new KvkFileWriter;
const binary: BUILDER_KVK_FILE = writer['build'](vk);
checkBuilderKvkFile(binary, vk);
});
it('can handle a non-null key bitmap', () => {
const vk = initVisualKeyboard([
initVisualKeyboardKey(
0,
BUILDER_KVK_KEY_FLAGS.kvkkBitmap,
BUILDER_KVK_SHIFT_STATE.KVKS_NORMAL,
"text",
[0],
),
initVisualKeyboardKey(1),
initVisualKeyboardKey(2),
]);
const writer = new KvkFileWriter;
const binary: BUILDER_KVK_FILE = writer['build'](vk);
checkBuilderKvkFile(binary, vk);
});
});
describe('Test of setString()', () => {
it('can set a BUILDER_KVK_STRING', () => {
Expand Down

0 comments on commit 47794cf

Please sign in to comment.