From 59cf3a00d1cc4cc32dfa231738de3943bde64af5 Mon Sep 17 00:00:00 2001 From: Sabine Date: Tue, 8 Jul 2025 09:07:58 +0200 Subject: [PATCH 1/3] feat(developer): changes in makePathToFixture in tests --- .../test/keylayout-to-kmn-converter.tests.ts | 39 ++++++++++--------- .../kmc-convert/test/kmn-file-reader.tests.ts | 6 +-- .../kmc-convert/test/kmn-file-writer.tests.ts | 20 +++++----- 3 files changed, 33 insertions(+), 32 deletions(-) diff --git a/developer/src/kmc-convert/test/keylayout-to-kmn-converter.tests.ts b/developer/src/kmc-convert/test/keylayout-to-kmn-converter.tests.ts index d196efe11e..6d604660f9 100644 --- a/developer/src/kmc-convert/test/keylayout-to-kmn-converter.tests.ts +++ b/developer/src/kmc-convert/test/keylayout-to-kmn-converter.tests.ts @@ -53,7 +53,8 @@ describe('KeylayoutToKmnConverter', function () { }); it('run() should throw on unavailable input file name and null output file name', async function () { - const inputFilename = makePathToFixture('../data/Unavailable.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Unavailable.keylayout'); + const result = sut.run(inputFilename, null); assert.isNotNull(result); assert.equal(compilerTestCallbacks.messages.length, 2); @@ -62,24 +63,24 @@ describe('KeylayoutToKmnConverter', function () { }); it('run() should return on correct input file name and empty output file name ', async function () { - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); await NodeAssert.doesNotReject(async () => sut.run(inputFilename, '')); }); it('run() should return on correct input file name and null output file name', async function () { - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); await NodeAssert.doesNotReject(async () => sut.run(inputFilename, null)); }); it('run() should return on correct input file name and given output file name ', async function () { - const inputFilename = makePathToFixture('../data/Test.keylayout'); - const outputFilename = makePathToFixture('../data/OutputName.kmn'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); + const outputFilename = makePathToFixture('../' + 'data' + '/OutputName.kmn'); await NodeAssert.doesNotReject(async () => sut.run(inputFilename, outputFilename)); }); it('run() should throw on incorrect input file extention and output file extention', async function () { - const inputFilename = makePathToFixture('../data/Test_command.A'); - const outputFilename = makePathToFixture('../data/data/OutputXName.B'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test_command.A'); + const outputFilename = makePathToFixture('../' + 'data' + '/data/OutputXName.B'); const result = sut.run(inputFilename, outputFilename); assert.isNotNull(result); assert.equal(compilerTestCallbacks.messages.length, 2); @@ -88,8 +89,8 @@ describe('KeylayoutToKmnConverter', function () { }); it('run() return on correct input file extention and unsupperted output file extention', async function () { - const inputFilename = makePathToFixture('../data/Test.keylayout'); - const outputFilename = makePathToFixture('../data/OutputXName.B'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); + const outputFilename = makePathToFixture('../' + 'data' + '/OutputXName.B'); await NodeAssert.doesNotReject(async () => sut.run(inputFilename, outputFilename)); }); }); @@ -97,7 +98,7 @@ describe('KeylayoutToKmnConverter', function () { describe('convert() ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); const converted = sut.convert_bound.convert(read, inputFilename.replace(/\.keylayout$/, '.kmn')); @@ -258,7 +259,7 @@ describe('KeylayoutToKmnConverter', function () { describe('get_Modifier_array__From__KeyModifier_array ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); const converted = sut.convert_bound.convert(read, inputFilename.replace(/\.keylayout$/, '.kmn')); @@ -294,7 +295,7 @@ describe('KeylayoutToKmnConverter', function () { describe('get_KeyModifier_array__From__ActionID ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); [ @@ -327,7 +328,7 @@ describe('KeylayoutToKmnConverter', function () { describe('get_ActionID__From__ActionNext ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); [ @@ -360,7 +361,7 @@ describe('KeylayoutToKmnConverter', function () { describe('get_ActionIndex__From__ActionId ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); [ @@ -388,7 +389,7 @@ describe('KeylayoutToKmnConverter', function () { describe('get_Output__From__ActionId_None ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); [ @@ -421,7 +422,7 @@ describe('KeylayoutToKmnConverter', function () { describe('get_KeyMBehaviourModOutputArray__from__KeyActionBehaviourOutput_array ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); /*Italian: @@ -607,7 +608,7 @@ describe('KeylayoutToKmnConverter', function () { describe('get_ActionStateOutput_array__From__ActionState ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); /* @@ -679,7 +680,7 @@ describe('KeylayoutToKmnConverter', function () { describe('get_ActionOutputBehaviourKeyModi_From__ActionIDStateOutput ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); const converted = sut.convert_bound.convert(read, inputFilename.replace(/\.keylayout$/, '.kmn')); /* Italian: [ @@ -737,7 +738,7 @@ describe('KeylayoutToKmnConverter', function () { describe('get_KeyActionOutput_array__From__ActionStateOutput_array ', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); /* Italian: const b6_actionId_arr = [ diff --git a/developer/src/kmc-convert/test/kmn-file-reader.tests.ts b/developer/src/kmc-convert/test/kmn-file-reader.tests.ts index c6bdcca108..99ca117106 100644 --- a/developer/src/kmc-convert/test/kmn-file-reader.tests.ts +++ b/developer/src/kmc-convert/test/kmn-file-reader.tests.ts @@ -25,7 +25,7 @@ describe('KeylayoutFileReader', function () { const sut_r = new KeylayoutFileReader(compilerTestCallbacks); it('read() should return filled array on correct input', async function () { - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const result = sut_r.read(inputFilename); assert.isNotEmpty(result); }); @@ -46,13 +46,13 @@ describe('KeylayoutFileReader', function () { }); it('read() should return empty array on unavailable file name', async function () { - const inputFilename_unavailable = makePathToFixture('../data/X.keylayout'); + const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); const result = sut_r.read(inputFilename_unavailable); assert.isNull(result); }); it('read() should return empty array on typo in path', async function () { - const result = sut_r.read(makePathToFixture('../data|Test.keylayout')); + const result = sut_r.read(makePathToFixture('../' + 'data' + '|Test.keylayout')); assert.isNull(result); }); }); 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 17c810ed1a..ef5b8521ca 100644 --- a/developer/src/kmc-convert/test/kmn-file-writer.tests.ts +++ b/developer/src/kmc-convert/test/kmn-file-writer.tests.ts @@ -23,7 +23,7 @@ describe('KmnFileWriter', function () { }); describe("write() ", function () { - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); const sut_w = new KmnFileWriter(compilerTestCallbacks, compilerTestOptions); @@ -31,7 +31,7 @@ describe('KmnFileWriter', function () { const converted = sut.convert_bound.convert(read, '/Test.keylayout'.replace(/\.keylayout$/, '.kmn')); // empty convert_object from unavailable file name - const inputFilename_unavailable = makePathToFixture('../data/X.keylayout'); + const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); const read_unavailable = sut_r.read(inputFilename_unavailable); const converted_unavailable = sut.convert_bound.convert(read_unavailable, inputFilename_unavailable.replace(/\.keylayout$/, '.kmn')); @@ -49,7 +49,7 @@ describe('KmnFileWriter', function () { }); describe("writeToString() ", function () { - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); const sut_w = new KmnFileWriter(compilerTestCallbacks, compilerTestOptions); @@ -72,7 +72,7 @@ describe('KmnFileWriter', function () { + "\n"; // empty convert_object from unavailable file name - //const inputFilename_unavailable = makePathToFixture('../data/X.keylayout'); + //const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); const inputFilename_unavailable = '/X.keylayout'; const read_unavailable = sut_r.read(inputFilename_unavailable); const converted_unavailable = sut.convert_bound.convert(read_unavailable, inputFilename_unavailable.replace(/\.keylayout$/, '.kmn')); @@ -89,7 +89,7 @@ describe('KmnFileWriter', function () { }); describe("writeToUint8Array() ", function () { - //const inputFilename = makePathToFixture('../data/Test.keylayout'); + //const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const inputFilename = '/Test.keylayout'; const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); @@ -115,7 +115,7 @@ describe('KmnFileWriter', function () { // empty convert_object from unavailable file name - const inputFilename_unavailable = makePathToFixture('../data/X.keylayout'); + const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); const read_unavailable = sut_r.read(inputFilename_unavailable); const converted_unavailable = sut.convert_bound.convert(read_unavailable, inputFilename_unavailable.replace(/\.keylayout$/, '.kmn')); it('writeToUint8Array() should return header in case of missing inputfile', async function () { @@ -130,7 +130,7 @@ describe('KmnFileWriter', function () { }); describe("writeData_Rules() ", function () { - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); const sut_w = new KmnFileWriter(compilerTestCallbacks, compilerTestOptions); @@ -138,7 +138,7 @@ describe('KmnFileWriter', function () { const converted = sut.convert_bound.convert(read, inputFilename.replace(/\.keylayout$/, '.kmn')); // empty convert_object from unavailable file name - const inputFilename_unavailable = makePathToFixture('../data/X.keylayout'); + const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); const read_unavailable = sut_r.read(inputFilename_unavailable); const converted_unavailable = sut.convert_bound.convert(read_unavailable, inputFilename_unavailable.replace(/\.keylayout$/, '.kmn')); @@ -158,12 +158,12 @@ describe('KmnFileWriter', function () { const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); const sut_w = new KmnFileWriter(compilerTestCallbacks, compilerTestOptions); - const inputFilename = makePathToFixture('../data/Test.keylayout'); + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); const converted = sut.convert_bound.convert(read, inputFilename.replace(/\.keylayout$/, '.kmn')); // empty convert_object from unavailable file name - const inputFilename_unavailable = makePathToFixture('../data/X.keylayout'); + const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); const read_unavailable = sut_r.read(inputFilename_unavailable); const converted_unavailable = sut.convert_bound.convert(read_unavailable, inputFilename_unavailable.replace(/\.keylayout$/, '.kmn')); From 979d74887d6b36b98675e848f5aa32b38bb4cb69 Mon Sep 17 00:00:00 2001 From: Sabine Date: Tue, 8 Jul 2025 11:35:02 +0200 Subject: [PATCH 2/3] feat(developer): failing test write(): convert() use correct filepath --- .../test/keylayout-to-kmn-converter.tests.ts | 206 +----------------- .../kmc-convert/test/kmn-file-reader.tests.ts | 2 - .../kmc-convert/test/kmn-file-writer.tests.ts | 9 +- 3 files changed, 7 insertions(+), 210 deletions(-) diff --git a/developer/src/kmc-convert/test/keylayout-to-kmn-converter.tests.ts b/developer/src/kmc-convert/test/keylayout-to-kmn-converter.tests.ts index 6d604660f9..cfb42889c8 100644 --- a/developer/src/kmc-convert/test/keylayout-to-kmn-converter.tests.ts +++ b/developer/src/kmc-convert/test/keylayout-to-kmn-converter.tests.ts @@ -54,7 +54,6 @@ describe('KeylayoutToKmnConverter', function () { it('run() should throw on unavailable input file name and null output file name', async function () { const inputFilename = makePathToFixture('../' + 'data' + '/Unavailable.keylayout'); - const result = sut.run(inputFilename, null); assert.isNotNull(result); assert.equal(compilerTestCallbacks.messages.length, 2); @@ -102,12 +101,12 @@ describe('KeylayoutToKmnConverter', function () { const read = sut_r.read(inputFilename); const converted = sut.convert_bound.convert(read, inputFilename.replace(/\.keylayout$/, '.kmn')); - // empty convert_object from unavailable file name - const inputFilename_unavailable = makePathToFixture('X.keylayout'); + // convert_object from unavailable file name + const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); const read_unavailable = sut_r.read(inputFilename_unavailable); const converted_unavailable = sut.convert_bound.convert(read_unavailable, inputFilename_unavailable.replace(/\.keylayout$/, '.kmn')); - // empty convert_object from empty filename + // convert_object from empty filename const inputFilename_empty = makePathToFixture(''); const read_empty = sut_r.read(inputFilename_empty); const converted_empty = sut.convert_bound.convert(read_empty, inputFilename_empty.replace(/\.keylayout$/, '.kmn')); @@ -265,7 +264,6 @@ describe('KeylayoutToKmnConverter', function () { [ [[['0', 0]], [['', 'shift? caps? ']]], - // Italian: [[['0', 1]], [['anyShift caps?', 'shift? rightShift caps? ', 'shift? leftShift caps? ', 'shift leftShift caps ']]], [[['0', 2]], [['shift? leftShift caps? ', 'anyShift caps?', 'shift leftShift caps ', 'shift? rightShift caps? ']]], [[['0', 999]], [null]], [[['999',]], [null]], @@ -299,13 +297,9 @@ describe('KeylayoutToKmnConverter', function () { const read = sut_r.read(inputFilename); [ - // Italian: ['a16', [['32', 3]]], - // Italian: ['a19', [['45', 3]]], - // Italian: ['a18', [['24', 0], ['24', 3]]], ['A_16', [['32', 5]]], ['A_19', [['45', 5]]], ['A_18', [['24', 0], ['24', 5]]], - ['unknown', []], [undefined, []], [null, []], @@ -333,17 +327,11 @@ describe('KeylayoutToKmnConverter', function () { [ ['none', ''], - // Italian: ['a18', ''], ['0', ''], - // Italian: ['1', 'a16'], - // Italian: // Italian: ['2', 'a8'], - // Italian: ['3', 'a17'], - ['A_18', ''], ['1', 'A_16'], ['2', 'A_8'], ['3', 'A_17'], - ['', ''], [' ', ''], ['99', ''], @@ -366,9 +354,6 @@ describe('KeylayoutToKmnConverter', function () { [ ['none', 0], - // Italian: ['a16', 8], - // Italian: ['a18', 10], - // Italian: ['a19', 11], ['A_16', 8], ['A_18', 10], ['A_19', 11], @@ -393,11 +378,9 @@ describe('KeylayoutToKmnConverter', function () { const read = sut_r.read(inputFilename); [ - // Italian: ['a14', 'u'], ['A_14', 'u'], ['', ''], [' ', ''], - // Italian: ['a18', undefined], ['A_18', undefined], ['unknown', ''], ].forEach(function (values) { @@ -424,74 +407,6 @@ describe('KeylayoutToKmnConverter', function () { const sut_r = new KeylayoutFileReader(compilerTestCallbacks); const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); - /*Italian: - - const b1_keycode_arr = [ - ['49', 'K_SPACE', 'a0', '0', 'ˆ'], - ['49', 'K_SPACE', 'a0', '1', 'ˆ'], - ['49', 'K_SPACE', 'a0', '2', 'ˆ'], - ['6', 'K_Z', 'a0', '4', 'ˆ'], - ['25', 'K_9', 'a0', '4', 'ˆ'], - ['43', 'K_COMMA', 'a0', '4', 'ˆ'], - ['49', 'K_SPACE', 'a0', '7', 'ˆ'], - ['0', 'K_A', 'a1', '1', 'Â'], - ['0', 'K_A', 'a1', '2', 'Â'], - ['14', 'K_E', 'a10', '0', 'ê'], - ['34', 'K_I', 'a11', '0', 'î'], - ['31', 'K_O', 'a13', '0', 'ô'], - ['32', 'K_U', 'a14', '0', 'û'], - ['14', 'K_E', 'a2', '1', 'Ê'], - ['14', 'K_E', 'a2', '2', 'Ê'], - ['34', 'K_I', 'a3', '1', 'Î'], - ['34', 'K_I', 'a3', '2', 'Î'], - ['31', 'K_O', 'a5', '1', 'Ô'], - ['31', 'K_O', 'a5', '2', 'Ô'], - ['32', 'K_U', 'a6', '1', 'Û'], - ['32', 'K_U', 'a6', '2', 'Û'], - ['0', 'K_A', 'a9', '0', 'â'] - ]; - const b1_modifierKey_arr = [ - ['K_SPACE', 'a0', '0', 'NCAPS', 'ˆ'], - ['K_SPACE', 'a0', '1', 'NCAPS SHIFT', 'ˆ'], - ['K_SPACE', 'a0', '1', 'SHIFT CAPS', 'ˆ'], - ['K_SPACE', 'a0', '2', 'CAPS', 'ˆ'], - ['K_Z', 'a0', '4', 'NCAPS SHIFT RALT', 'ˆ'], - ['K_9', 'a0', '4', 'NCAPS SHIFT RALT', 'ˆ'], - ['K_COMMA', 'a0', '4', 'NCAPS SHIFT RALT', 'ˆ'], - ['K_SPACE', 'a0', '7', 'NCAPS CTRL', 'ˆ'], - ['K_SPACE', 'a0', '7', 'NCAPS RALT CTRL', 'ˆ'], - ['K_A', 'a1', '1', 'NCAPS SHIFT', 'Â'], - ['K_A', 'a1', '1', 'SHIFT CAPS', 'Â'], - ['K_A', 'a1', '2', 'CAPS', 'Â'], - ['K_E', 'a10', '0', 'NCAPS', 'ê'], - ['K_I', 'a11', '0', 'NCAPS', 'î'], - ['K_O', 'a13', '0', 'NCAPS', 'ô'], - ['K_U', 'a14', '0', 'NCAPS', 'û'], - ['K_E', 'a2', '1', 'NCAPS SHIFT', 'Ê'], - ['K_E', 'a2', '1', 'SHIFT CAPS', 'Ê'], - ['K_E', 'a2', '2', 'CAPS', 'Ê'], - ['K_I', 'a3', '1', 'NCAPS SHIFT', 'Î'], - ['K_I', 'a3', '1', 'SHIFT CAPS', 'Î'], - ['K_I', 'a3', '2', 'CAPS', 'Î'], - ['K_O', 'a5', '1', 'NCAPS SHIFT', 'Ô'], - ['K_O', 'a5', '1', 'SHIFT CAPS', 'Ô'], - ['K_O', 'a5', '2', 'CAPS', 'Ô'], - ['K_U', 'a6', '1', 'NCAPS SHIFT', 'Û'], - ['K_U', 'a6', '1', 'SHIFT CAPS', 'Û'], - ['K_U', 'a6', '2', 'CAPS', 'Û'], - ['K_A', 'a9', '0', 'NCAPS', 'â'] - ]; - - [[b1_keycode_arr, b1_modifierKey_arr], - [[['49', 'K_SPACE', 'a0', '0', 'ˆ']], [['K_SPACE', 'a0', '0', 'NCAPS', 'ˆ']]], - [[['49', 'K_SPACE', 'a0', '0', '']], [['K_SPACE', 'a0', '0', 'NCAPS', '']]], - [[['49', 'K_SPACE', 'a0', '', 'ˆ']], [['K_SPACE', 'a0', '', 'NCAPS', 'ˆ']]], - [[['49', 'K_SPACE', '', '0', 'ˆ']], [['K_SPACE', '', '0', 'NCAPS', 'ˆ']]], - [[['49', '', 'a0', '0', 'ˆ']], [['', 'a0', '0', 'NCAPS', 'ˆ']]], - [[['', 'K_SPACE', 'a0', '0', 'ˆ']], [['K_SPACE', 'a0', '0', 'NCAPS', 'ˆ']]], - [[['', 'K_SPACE', 'a0', '0', 'ˆ']], [['K_SPACE', 'a0', '0', 'NCAPS', 'ˆ']]], - [[['', '', '', '', '']], [['', '', '', 'NCAPS', '']]], - */ const b1_keycode_arr = [ ['49', 'K_SPACE', 'A_0', '0', 'ˆ'], @@ -571,12 +486,6 @@ describe('KeylayoutToKmnConverter', function () { }); }); - /* Italian: [[[['49', 'K_SPACE', 'a0', '0', 'ˆ']], [['K_SPACE', 'a0', '0', '', 'ˆ']]], - [[['49', 'K_SPACE', 'a0', '0', '']], [['K_SPACE', 'a0', '0', '', '']]], - [[['', 'K_SPACE', 'a0', '0', 'ˆ']], [['K_SPACE', 'a0', '0', '', 'ˆ']]], - [[['', '', '', '', '']], [['', '', '', '', '']]], - ].forEach(function (values) { */ - [[[['49', 'K_SPACE', 'A_0', '0', 'ˆ']], [['K_SPACE', 'A_0', '0', '', 'ˆ']]], [[['49', 'K_SPACE', 'A_0', '0', '']], [['K_SPACE', 'A_0', '0', '', '']]], [[['', 'K_SPACE', 'A_0', '0', 'ˆ']], [['K_SPACE', 'A_0', '0', '', 'ˆ']]], @@ -611,32 +520,6 @@ describe('KeylayoutToKmnConverter', function () { const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); - /* - Italian:[['1', [ - ['a0', '1', 'ˆ'], - ['a1', '1', 'Â'], - ['a10', '1', 'ê'], - ['a11', '1', 'î'], - ['a13', '1', 'ô'], - ['a14', '1', 'û'], - ['a2', '1', 'Ê'], - ['a3', '1', 'Î'], - ['a5', '1', 'Ô'], - ['a6', '1', 'Û'], - ['a9', '1', 'â']],], - ['2', [ - ['a0', '2', '`'], - ['a1', '2', 'À'], - ['a10', '2', 'è'], - ['a11', '2', 'ì'], - ['a13', '2', 'ò'], - ['a14', '2', 'ù'], - ['a2', '2', 'È'], - ['a3', '2', 'Ì'], - ['a5', '2', 'Ò'], - ['a6', '2', 'Ù'], - ['a9', '2', 'à']],], - */ [['1', [ ['A_0', '1', 'ˆ'], ['A_1', '1', 'Â'], @@ -683,26 +566,6 @@ describe('KeylayoutToKmnConverter', function () { const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); const converted = sut.convert_bound.convert(read, inputFilename.replace(/\.keylayout$/, '.kmn')); - /* Italian: [ - ['a1', 'A', true, [ - ['a1', 'A', 'a1', '1', 'K_A', 'NCAPS SHIFT'], - ['a1', 'A', 'a1', '1', 'K_A', 'SHIFT CAPS'], - ['a1', 'A', 'a1', '2', 'K_A', 'CAPS']] - ], - ['a1', 'A', false, [ - ['a1', 'A', 'a1', '1', 'K_A', 'SHIFT'], - ['a1', 'A', 'a1', '1', 'K_A', 'SHIFT CAPS'], - ['a1', 'A', 'a1', '2', 'K_A', 'CAPS']] - ], - ['a9', 'a', true, [['a9', 'a', 'a9', '0', 'K_A', 'NCAPS']]], - ['a9', 'a', false, [['a9', 'a', 'a9', '0', 'K_A', '']]], - ['a9', 'a', , [['a9', 'a', 'a9', '0', 'K_A', '']]], - ['a9', '', true, [['a9', '', 'a9', '0', 'K_A', 'NCAPS']]], - ['a9', '', false, [['a9', '', 'a9', '0', 'K_A', '']]], - ['', 'a', true, []], - ['', 'a', false, []], - ['', '', , []], - */ [ ['A_1', 'A', true, [ @@ -741,44 +604,6 @@ describe('KeylayoutToKmnConverter', function () { const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const read = sut_r.read(inputFilename); - /* Italian: const b6_actionId_arr = [ - ['a0', '1', 'ˆ'], - ['a1', '1', 'Â'], - ['a10', '1', 'ê'], - ['a11', '1', 'î'], - ['a13', '1', 'ô'], - ['a14', '1', 'û'], - ['a2', '1', 'Ê'], - ['a3', '1', 'Î'], - ['a5', '1', 'Ô'], - ['a6', '1', 'Û'], - ['a9', '1', 'â'] - ]; - const b1_keycode_arr = [ - ['49', 'K_SPACE', 'a0', '0', 'ˆ'], - ['49', 'K_SPACE', 'a0', '1', 'ˆ'], - ['49', 'K_SPACE', 'a0', '2', 'ˆ'], - ['6', 'K_Z', 'a0', '4', 'ˆ'], - ['25', 'K_9', 'a0', '4', 'ˆ'], - ['43', 'K_COMMA', 'a0', '4', 'ˆ'], - ['49', 'K_SPACE', 'a0', '7', 'ˆ'], - ['0', 'K_A', 'a1', '1', 'Â'], - ['0', 'K_A', 'a1', '2', 'Â'], - ['14', 'K_E', 'a10', '0', 'ê'], - ['34', 'K_I', 'a11', '0', 'î'], - ['31', 'K_O', 'a13', '0', 'ô'], - ['32', 'K_U', 'a14', '0', 'û'], - ['14', 'K_E', 'a2', '1', 'Ê'], - ['14', 'K_E', 'a2', '2', 'Ê'], - ['34', 'K_I', 'a3', '1', 'Î'], - ['34', 'K_I', 'a3', '2', 'Î'], - ['31', 'K_O', 'a5', '1', 'Ô'], - ['31', 'K_O', 'a5', '2', 'Ô'], - ['32', 'K_U', 'a6', '1', 'Û'], - ['32', 'K_U', 'a6', '2', 'Û'], - ['0', 'K_A', 'a9', '0', 'â'] - ]; - */ const b6_actionId_arr = [ ['A_0', '1', 'ˆ'], ['A_1', '1', 'Â'], @@ -793,8 +618,6 @@ describe('KeylayoutToKmnConverter', function () { ['A_9', '1', 'â'] ]; const b1_keycode_arr = [ - - ['49', 'K_SPACE', 'A_0', '0', 'ˆ'], ['49', 'K_SPACE', 'A_0', '1', 'ˆ'], ['49', 'K_SPACE', 'A_0', '2', 'ˆ'], @@ -828,27 +651,6 @@ describe('KeylayoutToKmnConverter', function () { }); }); - //----------------- - /* Italian: const oneEntryResult = [ - ['49', 'K_SPACE', 'a0', '0', 'ˆ'], - ['49', 'K_SPACE', 'a0', '1', 'ˆ'], - ['49', 'K_SPACE', 'a0', '2', 'ˆ'], - ['6', 'K_Z', 'a0', '4', 'ˆ'], - ['25', 'K_9', 'a0', '4', 'ˆ'], - ['43', 'K_COMMA', 'a0', '4', 'ˆ'], - ['49', 'K_SPACE', 'a0', '7', 'ˆ'] - ]; - const oneEntryResultNoOutput = [ - ['49', 'K_SPACE', 'a0', '0', ''], - ['49', 'K_SPACE', 'a0', '1', ''], - ['49', 'K_SPACE', 'a0', '2', ''], - ['6', 'K_Z', 'a0', '4', ''], - ['25', 'K_9', 'a0', '4', ''], - ['43', 'K_COMMA', 'a0', '4', ''], - ['49', 'K_SPACE', 'a0', '7', ''] - ] ; - */ - const oneEntryResult = [ ['49', 'K_SPACE', 'A_0', '0', 'ˆ'], ['49', 'K_SPACE', 'A_0', '1', 'ˆ'], @@ -878,7 +680,6 @@ describe('KeylayoutToKmnConverter', function () { }); }); - //------------------------------------------------------------------------------------- [[[['', '1', 'ˆ']], []], [[['', '', '']], []], [[[' ', ' ', '']], []], @@ -889,7 +690,6 @@ describe('KeylayoutToKmnConverter', function () { }); }); - //------------------------------------------------------------------------------------- [[[], []], [undefined, []], [null, []], diff --git a/developer/src/kmc-convert/test/kmn-file-reader.tests.ts b/developer/src/kmc-convert/test/kmn-file-reader.tests.ts index 99ca117106..60fe42c2f5 100644 --- a/developer/src/kmc-convert/test/kmn-file-reader.tests.ts +++ b/developer/src/kmc-convert/test/kmn-file-reader.tests.ts @@ -12,8 +12,6 @@ import { assert } from 'chai'; import { compilerTestCallbacks, makePathToFixture } from './helpers/index.js'; import { KeylayoutFileReader } from '../src/keylayout-to-kmn/keylayout-file-reader.js'; -//----------------------------------------------------------------------------------------------------------------------- - describe('KeylayoutFileReader', function () { before(function () { 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 ef5b8521ca..6f005771b0 100644 --- a/developer/src/kmc-convert/test/kmn-file-writer.tests.ts +++ b/developer/src/kmc-convert/test/kmn-file-writer.tests.ts @@ -28,7 +28,8 @@ describe('KmnFileWriter', function () { const sut_r = new KeylayoutFileReader(compilerTestCallbacks); const sut_w = new KmnFileWriter(compilerTestCallbacks, compilerTestOptions); const read = sut_r.read(inputFilename); - const converted = sut.convert_bound.convert(read, '/Test.keylayout'.replace(/\.keylayout$/, '.kmn')); + const converted = sut.convert_bound.convert(read, inputFilename.replace(/\.keylayout$/, '.kmn')); + // empty convert_object from unavailable file name const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); @@ -72,8 +73,7 @@ describe('KmnFileWriter', function () { + "\n"; // empty convert_object from unavailable file name - //const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); - const inputFilename_unavailable = '/X.keylayout'; + const inputFilename_unavailable = makePathToFixture('../' + 'data' + '/X.keylayout'); const read_unavailable = sut_r.read(inputFilename_unavailable); const converted_unavailable = sut.convert_bound.convert(read_unavailable, inputFilename_unavailable.replace(/\.keylayout$/, '.kmn')); @@ -89,8 +89,7 @@ describe('KmnFileWriter', function () { }); describe("writeToUint8Array() ", function () { - //const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); - const inputFilename = '/Test.keylayout'; + const inputFilename = makePathToFixture('../' + 'data' + '/Test.keylayout'); const sut = new KeylayoutToKmnConverter(compilerTestCallbacks, compilerTestOptions); const sut_r = new KeylayoutFileReader(compilerTestCallbacks); const sut_w = new KmnFileWriter(compilerTestCallbacks, compilerTestOptions); From a81a3f820e7f9f0dfd0dc23937a63e3943dce768 Mon Sep 17 00:00:00 2001 From: Sabine Date: Tue, 8 Jul 2025 13:56:55 +0200 Subject: [PATCH 3/3] feat(developer): remove line --- .../src/kmc-convert/src/keylayout-to-kmn/kmn-file-writer.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/developer/src/kmc-convert/src/keylayout-to-kmn/kmn-file-writer.ts b/developer/src/kmc-convert/src/keylayout-to-kmn/kmn-file-writer.ts index 8fdeb377a1..6f73aa47b4 100644 --- a/developer/src/kmc-convert/src/keylayout-to-kmn/kmn-file-writer.ts +++ b/developer/src/kmc-convert/src/keylayout-to-kmn/kmn-file-writer.ts @@ -76,7 +76,6 @@ export class KmnFileWriter { } } - /** * @brief member function to create data for stores that will be printed to the resulting kmn file * @param data_ukelele an object containing all data read from a .keylayout file