From 754343b2a71de8a5c0dd9874de394a1d85e9aa2f Mon Sep 17 00:00:00 2001 From: Sabine Date: Tue, 2 Sep 2025 17:52:05 +0200 Subject: [PATCH] feat(developer): use convertToUnicodeCodePoint,convertToUnicodeCharacter from kmn-file-writer.ts --- .../src/kmc-convert/test/kmn-file-writer.tests.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/developer/src/kmc-convert/test/kmn-file-writer.tests.ts b/developer/src/kmc-convert/test/kmn-file-writer.tests.ts index 806558cb57..c2555f2bcd 100644 --- a/developer/src/kmc-convert/test/kmn-file-writer.tests.ts +++ b/developer/src/kmc-convert/test/kmn-file-writer.tests.ts @@ -9,7 +9,6 @@ import 'mocha'; import { assert } from 'chai'; -import { util } from '@keymanapp/common-types'; import KEYMAN_VERSION from "@keymanapp/keyman-version"; import { compilerTestCallbacks, compilerTestOptions, makePathToFixture } from './helpers/index.js'; import { KeylayoutToKmnConverter, ProcesData, Rule } from '../src/keylayout-to-kmn/keylayout-to-kmn-converter.js'; @@ -139,6 +138,7 @@ describe('KmnFileWriter', function () { }); describe('convertToUnicodeCodePoint ', function () { + const sut_w = new KmnFileWriter(compilerTestCallbacks, compilerTestOptions); [ ["􏘁", 'U+10F601'], ["😁", 'U+1F601'], @@ -161,13 +161,14 @@ describe('KmnFileWriter', function () { [' ;', ' ;'] ].forEach(function (values) { it(('should convert "' + values[0] + '"').padEnd(25, " ") + 'to "' + values[1] + '"', async function () { - const result = util.convertToUnicodeCodePoint(values[0] as string); + const result = sut_w.convertToUnicodeCodePoint(values[0] as string); assert.equal(result, values[1]); }); }); }); describe('convertToUnicodeCharacter ', function () { + const sut_w = new KmnFileWriter(compilerTestCallbacks, compilerTestOptions); [ ["a", 'a'], ["ሴ", 'ሴ'], @@ -177,8 +178,8 @@ describe('KmnFileWriter', function () { ["ሴ", 'ሴ'], ["😆", '😆'], ["󴉀", undefined], - ["U+0061;", 'a'], - ["U+1234;", 'ሴ'], + ["U+0061", 'a'], + ["U+1234", 'ሴ'], ["U+1F60E", '😎'], ["U+1000000;", undefined], ["@", undefined], @@ -192,7 +193,7 @@ describe('KmnFileWriter', function () { [null, undefined] ].forEach(function (values) { it(('should convert "' + values[0] + '"').padEnd(25, " ") + 'to "' + values[1] + '"', async function () { - const result = util.convertToUnicodeCharacter(values[0] as string); + const result = sut_w.convertToUnicodeCharacter(values[0] as string); assert.equal(result, values[1]); }); });