From f18bba2781a17af9ace107a048ac1d0eea805fe1 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Tue, 26 Nov 2024 16:20:43 +1000 Subject: [PATCH 01/22] docs(linux): update emscripten bash setup Update the linux and macos bash setup to documents. --- docs/build/linux-ubuntu.md | 13 +++++++++++++ docs/build/macos.md | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/docs/build/linux-ubuntu.md b/docs/build/linux-ubuntu.md index a45d9390ba..a7f15a29e0 100644 --- a/docs/build/linux-ubuntu.md +++ b/docs/build/linux-ubuntu.md @@ -70,10 +70,23 @@ git clone https://github.com/emscripten-core/emsdk.git cd emsdk ./emsdk install 3.1.58 ./emsdk activate 3.1.58 +cd upstream/emscripten +npm install export EMSCRIPTEN_BASE="$(pwd)/upstream/emscripten" echo "export EMSCRIPTEN_BASE=\"$EMSCRIPTEN_BASE\"" >> .bashrc ``` +If you are updating an existing install of Emscripten: + +```bash +cd emsdk +git pull +./emsdk install 3.1.58 +./emsdk activate 3.1.58 +cd upstream/emscripten +npm install +``` + > ![WARNING] > Don't put EMSDK on the path, i.e. don't source `emsdk_env.sh`. > diff --git a/docs/build/macos.md b/docs/build/macos.md index 25b0c1f82a..2baf0d5831 100644 --- a/docs/build/macos.md +++ b/docs/build/macos.md @@ -101,10 +101,23 @@ git clone https://github.com/emscripten-core/emsdk cd emsdk emsdk install 3.1.58 emsdk activate 3.1.58 +cd upstream/emscripten +npm install export EMSCRIPTEN_BASE="$(pwd)/upstream/emscripten" echo "export EMSCRIPTEN_BASE=\"$EMSCRIPTEN_BASE\"" >> .bashrc ``` +If you are updating an existing install of Emscripten: + +```bash +cd emsdk +git pull +emsdk install 3.1.58 +emsdk activate 3.1.58 +cd upstream/emscripten +npm install +``` + You will want to add `EMSCRIPTEN_BASE` to your .bashrc. > ![WARNING] From 2cb2e8c4fb8a272e38cd7744aad2b9d5a39d8dc0 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Tue, 26 Nov 2024 08:08:15 +0000 Subject: [PATCH 02/22] chore(developer): initial commit of test-string-lists.ts --- common/web/types/.gitignore | 3 ++- .../web/types/test/ldml-keyboard/test-string-list.ts | 11 +++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 common/web/types/test/ldml-keyboard/test-string-list.ts diff --git a/common/web/types/.gitignore b/common/web/types/.gitignore index 2f943a2f4e..dcb567b832 100644 --- a/common/web/types/.gitignore +++ b/common/web/types/.gitignore @@ -1,2 +1,3 @@ src/schemas/ -obj/ \ No newline at end of file +obj/ +coverage/ diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts new file mode 100644 index 0000000000..ea29249d7e --- /dev/null +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -0,0 +1,11 @@ +import 'mocha'; +import { assert } from 'chai'; +//import { ListIndex, ListItem } from '../../src/ldml-keyboard/string-list.js'; + +describe('Test of String-List', () => { + describe('should test ultimate truth', () => { + it('the truth', () => { + assert.isTrue(true); + }); + }); +}); \ No newline at end of file From d86e499f9c81cff862ff2b15ffcc983e0bb356d9 Mon Sep 17 00:00:00 2001 From: rc-swag <58423624+rc-swag@users.noreply.github.com> Date: Tue, 26 Nov 2024 18:47:44 +1000 Subject: [PATCH 03/22] docs(common): apply review comments Co-authored-by: Eberhard Beilharz Co-authored-by: Marc Durdin --- docs/build/linux-ubuntu.md | 2 +- docs/build/macos.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/build/linux-ubuntu.md b/docs/build/linux-ubuntu.md index a7f15a29e0..37b2aafa1a 100644 --- a/docs/build/linux-ubuntu.md +++ b/docs/build/linux-ubuntu.md @@ -72,7 +72,7 @@ cd emsdk ./emsdk activate 3.1.58 cd upstream/emscripten npm install -export EMSCRIPTEN_BASE="$(pwd)/upstream/emscripten" +export EMSCRIPTEN_BASE="$(pwd)" echo "export EMSCRIPTEN_BASE=\"$EMSCRIPTEN_BASE\"" >> .bashrc ``` diff --git a/docs/build/macos.md b/docs/build/macos.md index 2baf0d5831..f961942070 100644 --- a/docs/build/macos.md +++ b/docs/build/macos.md @@ -103,7 +103,7 @@ emsdk install 3.1.58 emsdk activate 3.1.58 cd upstream/emscripten npm install -export EMSCRIPTEN_BASE="$(pwd)/upstream/emscripten" +export EMSCRIPTEN_BASE="$(pwd)" echo "export EMSCRIPTEN_BASE=\"$EMSCRIPTEN_BASE\"" >> .bashrc ``` From fa4f1e5d0fc7acb8c41c4787c68a4df13f8b1bd2 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Tue, 26 Nov 2024 08:50:36 +0000 Subject: [PATCH 04/22] chore(developer): add one ListItem test case --- .../web/types/test/ldml-keyboard/test-string-list.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index ea29249d7e..0f73bbf93f 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -1,11 +1,14 @@ import 'mocha'; import { assert } from 'chai'; //import { ListIndex, ListItem } from '../../src/ldml-keyboard/string-list.js'; +import { ListItem } from '../../src/ldml-keyboard/string-list.js'; describe('Test of String-List', () => { - describe('should test ultimate truth', () => { - it('the truth', () => { - assert.isTrue(true); + describe('should test ListItem', () => { + it('fromStrings returns an empty ListItem if source is null', () => { + const actual = ListItem.fromStrings(null, null, null); + const expected = new ListItem(); + assert.deepEqual(actual, expected); }); }); -}); \ No newline at end of file +}); From 432ab7055f43ec3747f1614c5a0948b35d271f49 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 26 Nov 2024 11:04:01 +0100 Subject: [PATCH 05/22] chore(web): rename test files and folders This change renames the test files for Web according to the discussion at the Keyman conference in November 2024. It also renames some folders from `test` to `tests`. --- web/build.sh | 4 ++-- web/src/engine/common/web-utils/.c8rc.json | 2 +- web/src/engine/common/web-utils/.gitignore | 1 - web/src/engine/common/web-utils/build.sh | 2 +- .../deepCopy.js => tests/deepCopy.tests.js} | 0 .../managedPromise.tests.js} | 0 .../priorityQueue.tests.js} | 0 .../timeoutPromise.tests.js} | 0 .../versions.js => tests/versions.tests.js} | 0 web/src/engine/common/web-utils/tsconfig.json | 2 +- .../predictive-text/templates/.c8rc.json | 2 +- .../engine/predictive-text/templates/build.sh | 2 +- .../predictive-text/templates/package.json | 2 +- .../test-common.js => tests/common.tests.js} | 0 .../{test => tests}/custom-breakers.def.js | 0 .../fixtures/tries/accented.json | 0 .../fixtures/tries/english-1000.json | 0 .../fixtures/tries/smp-apple.json | 0 .../templates/{test => tests}/helpers.js | 0 .../quote-behavior.tests.js} | 0 .../tokenization.tests.js} | 0 .../trie-model.tests.js} | 0 .../trie-traversal.tests.js} | 0 .../predictive-text/templates/tsconfig.json | 2 +- .../predictive-text/wordbreakers/.c8rc.json | 2 +- .../predictive-text/wordbreakers/build.sh | 8 ++++--- .../predictive-text/wordbreakers/package.json | 2 +- .../ascii-word-breaker.tests.js} | 0 .../default-word-breaker.tests.js} | 0 .../placeholder-word-breaker.tests.js} | 0 .../search-property.tests.js} | 0 ...romise-store.js => promise-store.tests.js} | 0 ...-lmlayer.js => top-level-lmlayer.tests.js} | 0 ...n.js => worker-dummy-integration.tests.js} | 0 ...on.js => worker-trie-integration.tests.js} | 0 ...yer.spec.ts => top-level-lmlayer.tests.ts} | 0 ...c.ts => worker-dummy-integration.tests.ts} | 0 ...ec.ts => worker-trie-integration.tests.ts} | 0 .../in_browser/web-test-runner.config.mjs | 2 +- .../predictive-text/worker-thread/.c8rc.json | 2 +- .../predictive-text/worker-thread/build.sh | 4 ++-- .../mocha/cases/auto-correct.js | 0 .../mocha/cases/casing-detection.js | 0 .../cases/early-correction-search-stopping.js | 0 .../edit-distance/classical-calculation.js | 0 .../cases/edit-distance/context-tracker.js | 0 .../cases/edit-distance/distance-modeler.js | 0 .../cases/edit-distance/execution-timer.js | 0 .../mocha/cases/predict-from-corrections.js | 0 .../mocha/cases/suggestion-deduplication.js | 0 .../mocha/cases/suggestion-finalization.js | 0 .../mocha/cases/suggestion-similarity.js | 0 .../mocha/cases/transform-tokenization.js | 0 .../mocha/cases/transform-utils.js | 0 .../mocha/cases/worker-custom-punctuation.js | 0 .../mocha/cases/worker-initialization.js | 0 .../mocha/cases/worker-model-compositor.js | 0 .../mocha/cases/worker-predict-dummy.js | 0 .../mocha/cases/worker-predict.js | 0 .../test-runner/cases/worker.tests.ts} | 0 .../test-runner/web-test-runner.CI.config.mjs | 0 .../test-runner/web-test-runner.config.mjs | 2 +- ...html => outputTargetForElement.tests.html} | 0 ....spec.ts => pageContextAttachment.test.ts} | 0 ...anager.spec.ts => contextManager.tests.ts} | 0 .../{cookies.spec.ts => cookies.tests.ts} | 0 ...es.spec.ts => element_interfaces.tests.ts} | 0 ...et_mocks.spec.ts => target_mocks.tests.ts} | 0 .../{canary.spec.ts => canary.tests.ts} | 0 ...st-page.spec.html => host-page.tests.html} | 6 ++--- ...dInputs.spec.ts => ignoredInputs.tests.ts} | 0 ...pec.ts => recordedCoordSequences.tests.ts} | 0 ...dQueries.spec.ts => cloudQueries.tests.ts} | 0 ...ter.spec.ts => domCloudRequester.tests.ts} | 0 ...spec.ts => keyboardRequisitioner.tests.ts} | 0 ...der.spec.ts => domKeyboardLoader.tests.ts} | 0 ...activation.spec.ts => activation.tests.ts} | 0 .../osk/{events.spec.ts => events.tests.ts} | 0 ...init_check.spec.ts => init_check.tests.ts} | 0 .../test/auto/dom/web-test-runner.config.mjs | 24 +++++++++---------- ...enerSpy.js => emitterListenerSpy.tests.js} | 0 ...Emitter.js => legacyEventEmitter.tests.js} | 0 ...guration.js => pathConfiguration.tests.js} | 0 ...ext.spec.js => predictionContext.tests.js} | 0 ...{basic-engine.js => basic-engine.tests.js} | 0 .../{basic-init.js => basic-init.tests.js} | 0 ...dled-module.js => bundled-module.tests.js} | 0 .../{chirality.js => chirality.tests.js} | 0 .../{deadkeys.js => deadkeys.tests.js} | 0 .../engine/{context.js => context.tests.js} | 0 ...any_context.js => notany_context.tests.js} | 0 .../engine/{stores.js => stores.tests.js} | 0 ...roup.js => unmatched_final_group.tests.js} | 0 .../js-processor/{mocks.js => mocks.tests.js} | 0 ...rules.js => non-positional-rules.tests.js} | 0 ...pace.js => specialized-backspace.tests.js} | 0 ...nscriptions.js => transcriptions.tests.js} | 0 ...{cloudQueries.js => cloudQueries.tests.js} | 0 ...oner.js => keyboardRequisitioner.tests.js} | 0 ...{keyboardStub.js => keyboardStub.tests.js} | 0 ...quester.js => nodeCloudRequester.tests.js} | 0 ...Cache.js => stubAndKeyboardCache.tests.js} | 0 ...d-loading.js => keyboard-loading.tests.js} | 0 ...erties.js => keyboard-properties.tests.js} | 0 ...cessor.spec.js => inputProcessor.tests.js} | 0 ...sor.spec.js => languageProcessor.tests.js} | 0 .../cases/{basics.spec.ts => basics.tests.ts} | 0 .../cases/{engine.spec.ts => engine.tests.ts} | 0 ...lity.spec.ts => engine_chirality.tests.ts} | 0 .../cases/{events.spec.ts => events.tests.ts} | 0 ...ection.spec.ts => text_selection.tests.ts} | 0 ...init_check.spec.ts => init_check.tests.ts} | 0 .../integrated/web-test-runner.config.mjs | 6 ++--- 113 files changed, 39 insertions(+), 38 deletions(-) rename web/src/engine/common/web-utils/src/{test/deepCopy.js => tests/deepCopy.tests.js} (100%) rename web/src/engine/common/web-utils/src/{test/managedPromise.js => tests/managedPromise.tests.js} (100%) rename web/src/engine/common/web-utils/src/{test/priorityQueue.js => tests/priorityQueue.tests.js} (100%) rename web/src/engine/common/web-utils/src/{test/timeoutPromise.js => tests/timeoutPromise.tests.js} (100%) rename web/src/engine/common/web-utils/src/{test/versions.js => tests/versions.tests.js} (100%) rename web/src/engine/predictive-text/templates/{test/test-common.js => tests/common.tests.js} (100%) rename web/src/engine/predictive-text/templates/{test => tests}/custom-breakers.def.js (100%) rename web/src/engine/predictive-text/templates/{test => tests}/fixtures/tries/accented.json (100%) rename web/src/engine/predictive-text/templates/{test => tests}/fixtures/tries/english-1000.json (100%) rename web/src/engine/predictive-text/templates/{test => tests}/fixtures/tries/smp-apple.json (100%) rename web/src/engine/predictive-text/templates/{test => tests}/helpers.js (100%) rename web/src/engine/predictive-text/templates/{test/test-quote-behavior.js => tests/quote-behavior.tests.js} (100%) rename web/src/engine/predictive-text/templates/{test/test-tokenization.js => tests/tokenization.tests.js} (100%) rename web/src/engine/predictive-text/templates/{test/test-trie-model.js => tests/trie-model.tests.js} (100%) rename web/src/engine/predictive-text/templates/{test/test-trie-traversal.js => tests/trie-traversal.tests.js} (100%) rename web/src/engine/predictive-text/wordbreakers/{test/test-ascii-word-breaker.js => tests/ascii-word-breaker.tests.js} (100%) rename web/src/engine/predictive-text/wordbreakers/{test/test-default-word-breaker.js => tests/default-word-breaker.tests.js} (100%) rename web/src/engine/predictive-text/wordbreakers/{test/test-placeholder-word-breaker.js => tests/placeholder-word-breaker.tests.js} (100%) rename web/src/engine/predictive-text/wordbreakers/{test/test-search-property.js => tests/search-property.tests.js} (100%) rename web/src/engine/predictive-text/worker-main/unit_tests/headless/{promise-store.js => promise-store.tests.js} (100%) rename web/src/engine/predictive-text/worker-main/unit_tests/headless/{top-level-lmlayer.js => top-level-lmlayer.tests.js} (100%) rename web/src/engine/predictive-text/worker-main/unit_tests/headless/{worker-dummy-integration.js => worker-dummy-integration.tests.js} (100%) rename web/src/engine/predictive-text/worker-main/unit_tests/headless/{worker-trie-integration.js => worker-trie-integration.tests.js} (100%) rename web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/{top-level-lmlayer.spec.ts => top-level-lmlayer.tests.ts} (100%) rename web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/{worker-dummy-integration.spec.ts => worker-dummy-integration.tests.ts} (100%) rename web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/{worker-trie-integration.spec.ts => worker-trie-integration.tests.ts} (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/auto-correct.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/casing-detection.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/early-correction-search-stopping.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/edit-distance/classical-calculation.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/edit-distance/context-tracker.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/edit-distance/distance-modeler.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/edit-distance/execution-timer.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/predict-from-corrections.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/suggestion-deduplication.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/suggestion-finalization.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/suggestion-similarity.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/transform-tokenization.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/transform-utils.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/worker-custom-punctuation.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/worker-initialization.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/worker-model-compositor.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/worker-predict-dummy.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/mocha/cases/worker-predict.js (100%) rename web/src/engine/predictive-text/worker-thread/src/{test/test-runner/cases/worker.spec.ts => tests/test-runner/cases/worker.tests.ts} (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/test-runner/web-test-runner.CI.config.mjs (100%) rename web/src/engine/predictive-text/worker-thread/src/{test => tests}/test-runner/web-test-runner.config.mjs (99%) rename web/src/test/auto/dom/cases/attachment/{outputTargetForElement.spec.html => outputTargetForElement.tests.html} (100%) rename web/src/test/auto/dom/cases/attachment/{pageContextAttachment.spec.ts => pageContextAttachment.test.ts} (100%) rename web/src/test/auto/dom/cases/browser/{contextManager.spec.ts => contextManager.tests.ts} (100%) rename web/src/test/auto/dom/cases/dom-utils/{cookies.spec.ts => cookies.tests.ts} (100%) rename web/src/test/auto/dom/cases/element-wrappers/{element_interfaces.spec.ts => element_interfaces.tests.ts} (100%) rename web/src/test/auto/dom/cases/element-wrappers/{target_mocks.spec.ts => target_mocks.tests.ts} (100%) rename web/src/test/auto/dom/cases/gesture-processor/{canary.spec.ts => canary.tests.ts} (100%) rename web/src/test/auto/dom/cases/gesture-processor/{host-page.spec.html => host-page.tests.html} (92%) rename web/src/test/auto/dom/cases/gesture-processor/{ignoredInputs.spec.ts => ignoredInputs.tests.ts} (100%) rename web/src/test/auto/dom/cases/gesture-processor/{recordedCoordSequences.spec.ts => recordedCoordSequences.tests.ts} (100%) rename web/src/test/auto/dom/cases/keyboard-storage/{cloudQueries.spec.ts => cloudQueries.tests.ts} (100%) rename web/src/test/auto/dom/cases/keyboard-storage/{domCloudRequester.spec.ts => domCloudRequester.tests.ts} (100%) rename web/src/test/auto/dom/cases/keyboard-storage/{keyboardRequisitioner.spec.ts => keyboardRequisitioner.tests.ts} (100%) rename web/src/test/auto/dom/cases/keyboard/{domKeyboardLoader.spec.ts => domKeyboardLoader.tests.ts} (100%) rename web/src/test/auto/dom/cases/osk/{activation.spec.ts => activation.tests.ts} (100%) rename web/src/test/auto/dom/cases/osk/{events.spec.ts => events.tests.ts} (100%) rename web/src/test/auto/dom/{test_init_check.spec.ts => init_check.tests.ts} (100%) rename web/src/test/auto/headless/engine/events/{emitterListenerSpy.js => emitterListenerSpy.tests.js} (100%) rename web/src/test/auto/headless/engine/events/{legacyEventEmitter.js => legacyEventEmitter.tests.js} (100%) rename web/src/test/auto/headless/engine/interfaces/{pathConfiguration.js => pathConfiguration.tests.js} (100%) rename web/src/test/auto/headless/engine/interfaces/prediction/{predictionContext.spec.js => predictionContext.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/{basic-engine.js => basic-engine.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/{basic-init.js => basic-init.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/{bundled-module.js => bundled-module.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/{chirality.js => chirality.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/{deadkeys.js => deadkeys.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/engine/{context.js => context.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/engine/{notany_context.js => notany_context.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/engine/{stores.js => stores.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/engine/{unmatched_final_group.js => unmatched_final_group.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/{mocks.js => mocks.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/{non-positional-rules.js => non-positional-rules.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/{specialized-backspace.js => specialized-backspace.tests.js} (100%) rename web/src/test/auto/headless/engine/js-processor/{transcriptions.js => transcriptions.tests.js} (100%) rename web/src/test/auto/headless/engine/keyboard-storage/{cloudQueries.js => cloudQueries.tests.js} (100%) rename web/src/test/auto/headless/engine/keyboard-storage/{keyboardRequisitioner.js => keyboardRequisitioner.tests.js} (100%) rename web/src/test/auto/headless/engine/keyboard-storage/{keyboardStub.js => keyboardStub.tests.js} (100%) rename web/src/test/auto/headless/engine/keyboard-storage/{nodeCloudRequester.js => nodeCloudRequester.tests.js} (100%) rename web/src/test/auto/headless/engine/keyboard-storage/{stubAndKeyboardCache.js => stubAndKeyboardCache.tests.js} (100%) rename web/src/test/auto/headless/engine/keyboard/{keyboard-loading.js => keyboard-loading.tests.js} (100%) rename web/src/test/auto/headless/engine/keyboard/{keyboard-properties.js => keyboard-properties.tests.js} (100%) rename web/src/test/auto/headless/engine/main/headless/{inputProcessor.spec.js => inputProcessor.tests.js} (100%) rename web/src/test/auto/headless/engine/main/headless/{languageProcessor.spec.js => languageProcessor.tests.js} (100%) rename web/src/test/auto/integrated/cases/{basics.spec.ts => basics.tests.ts} (100%) rename web/src/test/auto/integrated/cases/{engine.spec.ts => engine.tests.ts} (100%) rename web/src/test/auto/integrated/cases/{engine_chirality.spec.ts => engine_chirality.tests.ts} (100%) rename web/src/test/auto/integrated/cases/{events.spec.ts => events.tests.ts} (100%) rename web/src/test/auto/integrated/cases/{text_selection.spec.ts => text_selection.tests.ts} (100%) rename web/src/test/auto/integrated/{test_init_check.spec.ts => init_check.tests.ts} (100%) diff --git a/web/build.sh b/web/build.sh index 6f1846dc6a..d01d493517 100755 --- a/web/build.sh +++ b/web/build.sh @@ -55,7 +55,7 @@ fi builder_describe_outputs \ configure "/node_modules" \ - build "/web/build/test/dom/cases/attachment/outputTargetForElement.spec.html" \ + build "/web/build/test/dom/cases/attachment/outputTargetForElement.tests.html" \ build:app/browser "/web/build/app/browser/lib/index.mjs" \ build:app/webview "/web/build/app/webview/${config}/keymanweb-webview.js" \ build:app/ui "/web/build/app/ui/${config}/kmwuitoggle.js" \ @@ -127,7 +127,7 @@ build_action() { precompile "${dir}" done - cp "${KEYMAN_ROOT}/web/src/test/auto/dom/cases/attachment/outputTargetForElement.spec.html" \ + cp "${KEYMAN_ROOT}/web/src/test/auto/dom/cases/attachment/outputTargetForElement.tests.html" \ "${KEYMAN_ROOT}/web/build/test/dom/cases/attachment/" } diff --git a/web/src/engine/common/web-utils/.c8rc.json b/web/src/engine/common/web-utils/.c8rc.json index d9074b62f3..16a4e93b9c 100644 --- a/web/src/engine/common/web-utils/.c8rc.json +++ b/web/src/engine/common/web-utils/.c8rc.json @@ -6,7 +6,7 @@ "src/deviceSpec.ts", "src/globalObject.ts", "node_modules/*", - "src/test" + "src/tests/*" ], "exclude-after-remap": true, "reporter": ["text", "text-summary"], diff --git a/web/src/engine/common/web-utils/.gitignore b/web/src/engine/common/web-utils/.gitignore index a9e0c25514..56baafc822 100644 --- a/web/src/engine/common/web-utils/.gitignore +++ b/web/src/engine/common/web-utils/.gitignore @@ -11,7 +11,6 @@ dist/ # Other local files. node_modules/ -unit_tests/modernizr.js source/environment.inc.ts **/.idea/**/*.xml **/*.iml diff --git a/web/src/engine/common/web-utils/build.sh b/web/src/engine/common/web-utils/build.sh index 303bd2664b..ac18e2984c 100755 --- a/web/src/engine/common/web-utils/build.sh +++ b/web/src/engine/common/web-utils/build.sh @@ -54,7 +54,7 @@ function do_test() { FLAGS="$FLAGS --reporter mocha-teamcity-reporter" fi - c8 mocha --recursive $FLAGS ./src/test/ + c8 mocha --recursive $FLAGS ./src/tests/ } builder_run_action configure verify_npm_setup diff --git a/web/src/engine/common/web-utils/src/test/deepCopy.js b/web/src/engine/common/web-utils/src/tests/deepCopy.tests.js similarity index 100% rename from web/src/engine/common/web-utils/src/test/deepCopy.js rename to web/src/engine/common/web-utils/src/tests/deepCopy.tests.js diff --git a/web/src/engine/common/web-utils/src/test/managedPromise.js b/web/src/engine/common/web-utils/src/tests/managedPromise.tests.js similarity index 100% rename from web/src/engine/common/web-utils/src/test/managedPromise.js rename to web/src/engine/common/web-utils/src/tests/managedPromise.tests.js diff --git a/web/src/engine/common/web-utils/src/test/priorityQueue.js b/web/src/engine/common/web-utils/src/tests/priorityQueue.tests.js similarity index 100% rename from web/src/engine/common/web-utils/src/test/priorityQueue.js rename to web/src/engine/common/web-utils/src/tests/priorityQueue.tests.js diff --git a/web/src/engine/common/web-utils/src/test/timeoutPromise.js b/web/src/engine/common/web-utils/src/tests/timeoutPromise.tests.js similarity index 100% rename from web/src/engine/common/web-utils/src/test/timeoutPromise.js rename to web/src/engine/common/web-utils/src/tests/timeoutPromise.tests.js diff --git a/web/src/engine/common/web-utils/src/test/versions.js b/web/src/engine/common/web-utils/src/tests/versions.tests.js similarity index 100% rename from web/src/engine/common/web-utils/src/test/versions.js rename to web/src/engine/common/web-utils/src/tests/versions.tests.js diff --git a/web/src/engine/common/web-utils/tsconfig.json b/web/src/engine/common/web-utils/tsconfig.json index a4d2e57702..1747a62274 100644 --- a/web/src/engine/common/web-utils/tsconfig.json +++ b/web/src/engine/common/web-utils/tsconfig.json @@ -13,6 +13,6 @@ "src/*.ts" ], "exclude": [ - "src/test/**/*.js" + "src/tests/**/*.js" ] } diff --git a/web/src/engine/predictive-text/templates/.c8rc.json b/web/src/engine/predictive-text/templates/.c8rc.json index deaa1318eb..d107a1cacb 100644 --- a/web/src/engine/predictive-text/templates/.c8rc.json +++ b/web/src/engine/predictive-text/templates/.c8rc.json @@ -3,7 +3,7 @@ "clean": true, "exclude": [ "node_modules/**", - "test/**" + "tests/**" ], "exclude-after-remap": true, "reporter": ["text", "text-summary"], diff --git a/web/src/engine/predictive-text/templates/build.sh b/web/src/engine/predictive-text/templates/build.sh index e7aaaac124..bf23622998 100755 --- a/web/src/engine/predictive-text/templates/build.sh +++ b/web/src/engine/predictive-text/templates/build.sh @@ -42,7 +42,7 @@ function do_test() { FLAGS="-reporter mocha-teamcity-reporter" fi - c8 mocha $FLAGS --require test/helpers.js --recursive test + c8 mocha $FLAGS --require tests/helpers.js --recursive tests } builder_run_action configure verify_npm_setup diff --git a/web/src/engine/predictive-text/templates/package.json b/web/src/engine/predictive-text/templates/package.json index c976bcdbe3..7b6604f773 100644 --- a/web/src/engine/predictive-text/templates/package.json +++ b/web/src/engine/predictive-text/templates/package.json @@ -31,7 +31,7 @@ "type": "module", "directories": { - "test": "test" + "test": "tests" }, "files": [ "index.js" diff --git a/web/src/engine/predictive-text/templates/test/test-common.js b/web/src/engine/predictive-text/templates/tests/common.tests.js similarity index 100% rename from web/src/engine/predictive-text/templates/test/test-common.js rename to web/src/engine/predictive-text/templates/tests/common.tests.js diff --git a/web/src/engine/predictive-text/templates/test/custom-breakers.def.js b/web/src/engine/predictive-text/templates/tests/custom-breakers.def.js similarity index 100% rename from web/src/engine/predictive-text/templates/test/custom-breakers.def.js rename to web/src/engine/predictive-text/templates/tests/custom-breakers.def.js diff --git a/web/src/engine/predictive-text/templates/test/fixtures/tries/accented.json b/web/src/engine/predictive-text/templates/tests/fixtures/tries/accented.json similarity index 100% rename from web/src/engine/predictive-text/templates/test/fixtures/tries/accented.json rename to web/src/engine/predictive-text/templates/tests/fixtures/tries/accented.json diff --git a/web/src/engine/predictive-text/templates/test/fixtures/tries/english-1000.json b/web/src/engine/predictive-text/templates/tests/fixtures/tries/english-1000.json similarity index 100% rename from web/src/engine/predictive-text/templates/test/fixtures/tries/english-1000.json rename to web/src/engine/predictive-text/templates/tests/fixtures/tries/english-1000.json diff --git a/web/src/engine/predictive-text/templates/test/fixtures/tries/smp-apple.json b/web/src/engine/predictive-text/templates/tests/fixtures/tries/smp-apple.json similarity index 100% rename from web/src/engine/predictive-text/templates/test/fixtures/tries/smp-apple.json rename to web/src/engine/predictive-text/templates/tests/fixtures/tries/smp-apple.json diff --git a/web/src/engine/predictive-text/templates/test/helpers.js b/web/src/engine/predictive-text/templates/tests/helpers.js similarity index 100% rename from web/src/engine/predictive-text/templates/test/helpers.js rename to web/src/engine/predictive-text/templates/tests/helpers.js diff --git a/web/src/engine/predictive-text/templates/test/test-quote-behavior.js b/web/src/engine/predictive-text/templates/tests/quote-behavior.tests.js similarity index 100% rename from web/src/engine/predictive-text/templates/test/test-quote-behavior.js rename to web/src/engine/predictive-text/templates/tests/quote-behavior.tests.js diff --git a/web/src/engine/predictive-text/templates/test/test-tokenization.js b/web/src/engine/predictive-text/templates/tests/tokenization.tests.js similarity index 100% rename from web/src/engine/predictive-text/templates/test/test-tokenization.js rename to web/src/engine/predictive-text/templates/tests/tokenization.tests.js diff --git a/web/src/engine/predictive-text/templates/test/test-trie-model.js b/web/src/engine/predictive-text/templates/tests/trie-model.tests.js similarity index 100% rename from web/src/engine/predictive-text/templates/test/test-trie-model.js rename to web/src/engine/predictive-text/templates/tests/trie-model.tests.js diff --git a/web/src/engine/predictive-text/templates/test/test-trie-traversal.js b/web/src/engine/predictive-text/templates/tests/trie-traversal.tests.js similarity index 100% rename from web/src/engine/predictive-text/templates/test/test-trie-traversal.js rename to web/src/engine/predictive-text/templates/tests/trie-traversal.tests.js diff --git a/web/src/engine/predictive-text/templates/tsconfig.json b/web/src/engine/predictive-text/templates/tsconfig.json index e8217e9ad9..176530290d 100644 --- a/web/src/engine/predictive-text/templates/tsconfig.json +++ b/web/src/engine/predictive-text/templates/tsconfig.json @@ -16,6 +16,6 @@ "src/**/*.ts" ], "exclude": [ - "test" + "tests" ] } diff --git a/web/src/engine/predictive-text/wordbreakers/.c8rc.json b/web/src/engine/predictive-text/wordbreakers/.c8rc.json index e1de5a5999..6a0e2589da 100644 --- a/web/src/engine/predictive-text/wordbreakers/.c8rc.json +++ b/web/src/engine/predictive-text/wordbreakers/.c8rc.json @@ -3,7 +3,7 @@ "clean": true, "exclude": [ "node_modules/*", - "test" + "tests" ], "exclude-after-remap": true, "reporter": ["text", "text-summary"], diff --git a/web/src/engine/predictive-text/wordbreakers/build.sh b/web/src/engine/predictive-text/wordbreakers/build.sh index 4591cc34e1..6505dfdd4f 100755 --- a/web/src/engine/predictive-text/wordbreakers/build.sh +++ b/web/src/engine/predictive-text/wordbreakers/build.sh @@ -45,11 +45,13 @@ function do_build() { } function do_test() { + local FLAGS= + if builder_has_option --ci; then - c8 mocha -reporter mocha-teamcity-reporter - else - c8 mocha + FLAGS="-reporter mocha-teamcity-reporter" fi + + c8 mocha ${FLAGS} tests } builder_run_action configure do_configure diff --git a/web/src/engine/predictive-text/wordbreakers/package.json b/web/src/engine/predictive-text/wordbreakers/package.json index 5ac5fd4a28..89c0469f30 100644 --- a/web/src/engine/predictive-text/wordbreakers/package.json +++ b/web/src/engine/predictive-text/wordbreakers/package.json @@ -34,7 +34,7 @@ }, "directories": { "lib": "lib", - "test": "test" + "test": "tests" }, "files": [ "lib" diff --git a/web/src/engine/predictive-text/wordbreakers/test/test-ascii-word-breaker.js b/web/src/engine/predictive-text/wordbreakers/tests/ascii-word-breaker.tests.js similarity index 100% rename from web/src/engine/predictive-text/wordbreakers/test/test-ascii-word-breaker.js rename to web/src/engine/predictive-text/wordbreakers/tests/ascii-word-breaker.tests.js diff --git a/web/src/engine/predictive-text/wordbreakers/test/test-default-word-breaker.js b/web/src/engine/predictive-text/wordbreakers/tests/default-word-breaker.tests.js similarity index 100% rename from web/src/engine/predictive-text/wordbreakers/test/test-default-word-breaker.js rename to web/src/engine/predictive-text/wordbreakers/tests/default-word-breaker.tests.js diff --git a/web/src/engine/predictive-text/wordbreakers/test/test-placeholder-word-breaker.js b/web/src/engine/predictive-text/wordbreakers/tests/placeholder-word-breaker.tests.js similarity index 100% rename from web/src/engine/predictive-text/wordbreakers/test/test-placeholder-word-breaker.js rename to web/src/engine/predictive-text/wordbreakers/tests/placeholder-word-breaker.tests.js diff --git a/web/src/engine/predictive-text/wordbreakers/test/test-search-property.js b/web/src/engine/predictive-text/wordbreakers/tests/search-property.tests.js similarity index 100% rename from web/src/engine/predictive-text/wordbreakers/test/test-search-property.js rename to web/src/engine/predictive-text/wordbreakers/tests/search-property.tests.js diff --git a/web/src/engine/predictive-text/worker-main/unit_tests/headless/promise-store.js b/web/src/engine/predictive-text/worker-main/unit_tests/headless/promise-store.tests.js similarity index 100% rename from web/src/engine/predictive-text/worker-main/unit_tests/headless/promise-store.js rename to web/src/engine/predictive-text/worker-main/unit_tests/headless/promise-store.tests.js diff --git a/web/src/engine/predictive-text/worker-main/unit_tests/headless/top-level-lmlayer.js b/web/src/engine/predictive-text/worker-main/unit_tests/headless/top-level-lmlayer.tests.js similarity index 100% rename from web/src/engine/predictive-text/worker-main/unit_tests/headless/top-level-lmlayer.js rename to web/src/engine/predictive-text/worker-main/unit_tests/headless/top-level-lmlayer.tests.js diff --git a/web/src/engine/predictive-text/worker-main/unit_tests/headless/worker-dummy-integration.js b/web/src/engine/predictive-text/worker-main/unit_tests/headless/worker-dummy-integration.tests.js similarity index 100% rename from web/src/engine/predictive-text/worker-main/unit_tests/headless/worker-dummy-integration.js rename to web/src/engine/predictive-text/worker-main/unit_tests/headless/worker-dummy-integration.tests.js diff --git a/web/src/engine/predictive-text/worker-main/unit_tests/headless/worker-trie-integration.js b/web/src/engine/predictive-text/worker-main/unit_tests/headless/worker-trie-integration.tests.js similarity index 100% rename from web/src/engine/predictive-text/worker-main/unit_tests/headless/worker-trie-integration.js rename to web/src/engine/predictive-text/worker-main/unit_tests/headless/worker-trie-integration.tests.js diff --git a/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/top-level-lmlayer.spec.ts b/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/top-level-lmlayer.tests.ts similarity index 100% rename from web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/top-level-lmlayer.spec.ts rename to web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/top-level-lmlayer.tests.ts diff --git a/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/worker-dummy-integration.spec.ts b/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/worker-dummy-integration.tests.ts similarity index 100% rename from web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/worker-dummy-integration.spec.ts rename to web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/worker-dummy-integration.tests.ts diff --git a/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/worker-trie-integration.spec.ts b/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/worker-trie-integration.tests.ts similarity index 100% rename from web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/worker-trie-integration.spec.ts rename to web/src/engine/predictive-text/worker-main/unit_tests/in_browser/cases/worker-trie-integration.tests.ts diff --git a/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/web-test-runner.config.mjs b/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/web-test-runner.config.mjs index 6f9df64ddb..e094aebe46 100644 --- a/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/web-test-runner.config.mjs +++ b/web/src/engine/predictive-text/worker-main/unit_tests/in_browser/web-test-runner.config.mjs @@ -19,7 +19,7 @@ export default { concurrency: 10, nodeResolve: true, files: [ - '**/*.spec.ts' + '**/*.tests.ts' ], middleware: [ // Rewrites short-hand paths for test resources, making them fully relative to the repo root. diff --git a/web/src/engine/predictive-text/worker-thread/.c8rc.json b/web/src/engine/predictive-text/worker-thread/.c8rc.json index 56bc01f350..b66bb5b106 100644 --- a/web/src/engine/predictive-text/worker-thread/.c8rc.json +++ b/web/src/engine/predictive-text/worker-thread/.c8rc.json @@ -2,7 +2,7 @@ "check-coverage": false, "clean": true, "exclude": [ - "src/test/**", + "src/tests/**", "node_modules/*" ], "exclude-after-remap": true, diff --git a/web/src/engine/predictive-text/worker-thread/build.sh b/web/src/engine/predictive-text/worker-thread/build.sh index 05c7326cd0..ddf332e90d 100755 --- a/web/src/engine/predictive-text/worker-thread/build.sh +++ b/web/src/engine/predictive-text/worker-thread/build.sh @@ -107,9 +107,9 @@ function do_test() { WTR_DEBUG=" --manual" fi - c8 mocha --recursive $MOCHA_FLAGS ./src/test/mocha/cases/ + c8 mocha --recursive $MOCHA_FLAGS ./src/tests/mocha/cases/ - web-test-runner --config ./src/test/test-runner/web-test-runner${WTR_CONFIG}.config.mjs ${WTR_DEBUG} + web-test-runner --config ./src/tests/test-runner/web-test-runner${WTR_CONFIG}.config.mjs ${WTR_DEBUG} } builder_run_action configure do_configure diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/auto-correct.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/auto-correct.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/auto-correct.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/auto-correct.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/casing-detection.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/casing-detection.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/casing-detection.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/casing-detection.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/early-correction-search-stopping.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/early-correction-search-stopping.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/early-correction-search-stopping.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/early-correction-search-stopping.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/edit-distance/classical-calculation.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/edit-distance/classical-calculation.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/edit-distance/classical-calculation.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/edit-distance/classical-calculation.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/edit-distance/context-tracker.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/edit-distance/context-tracker.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/edit-distance/context-tracker.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/edit-distance/context-tracker.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/edit-distance/distance-modeler.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/edit-distance/distance-modeler.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/edit-distance/distance-modeler.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/edit-distance/distance-modeler.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/edit-distance/execution-timer.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/edit-distance/execution-timer.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/edit-distance/execution-timer.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/edit-distance/execution-timer.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/predict-from-corrections.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/predict-from-corrections.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/predict-from-corrections.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/predict-from-corrections.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/suggestion-deduplication.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/suggestion-deduplication.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/suggestion-deduplication.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/suggestion-deduplication.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/suggestion-finalization.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/suggestion-finalization.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/suggestion-finalization.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/suggestion-finalization.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/suggestion-similarity.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/suggestion-similarity.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/suggestion-similarity.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/suggestion-similarity.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/transform-tokenization.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/transform-tokenization.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/transform-tokenization.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/transform-tokenization.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/transform-utils.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/transform-utils.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/transform-utils.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/transform-utils.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-custom-punctuation.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-custom-punctuation.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-custom-punctuation.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-custom-punctuation.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-initialization.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-initialization.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-initialization.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-initialization.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-model-compositor.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-model-compositor.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-model-compositor.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-model-compositor.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-predict-dummy.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-predict-dummy.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-predict-dummy.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-predict-dummy.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-predict.js b/web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-predict.js similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/mocha/cases/worker-predict.js rename to web/src/engine/predictive-text/worker-thread/src/tests/mocha/cases/worker-predict.js diff --git a/web/src/engine/predictive-text/worker-thread/src/test/test-runner/cases/worker.spec.ts b/web/src/engine/predictive-text/worker-thread/src/tests/test-runner/cases/worker.tests.ts similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/test-runner/cases/worker.spec.ts rename to web/src/engine/predictive-text/worker-thread/src/tests/test-runner/cases/worker.tests.ts diff --git a/web/src/engine/predictive-text/worker-thread/src/test/test-runner/web-test-runner.CI.config.mjs b/web/src/engine/predictive-text/worker-thread/src/tests/test-runner/web-test-runner.CI.config.mjs similarity index 100% rename from web/src/engine/predictive-text/worker-thread/src/test/test-runner/web-test-runner.CI.config.mjs rename to web/src/engine/predictive-text/worker-thread/src/tests/test-runner/web-test-runner.CI.config.mjs diff --git a/web/src/engine/predictive-text/worker-thread/src/test/test-runner/web-test-runner.config.mjs b/web/src/engine/predictive-text/worker-thread/src/tests/test-runner/web-test-runner.config.mjs similarity index 99% rename from web/src/engine/predictive-text/worker-thread/src/test/test-runner/web-test-runner.config.mjs rename to web/src/engine/predictive-text/worker-thread/src/tests/test-runner/web-test-runner.config.mjs index 920efab464..64ed2763db 100644 --- a/web/src/engine/predictive-text/worker-thread/src/test/test-runner/web-test-runner.config.mjs +++ b/web/src/engine/predictive-text/worker-thread/src/tests/test-runner/web-test-runner.config.mjs @@ -27,7 +27,7 @@ export default { concurrency: 10, nodeResolve: true, files: [ - '**/*.spec.ts' + '**/*.tests.ts' ], middleware: [ // Rewrites short-hand paths for test resources, making them fully relative to the repo root. diff --git a/web/src/test/auto/dom/cases/attachment/outputTargetForElement.spec.html b/web/src/test/auto/dom/cases/attachment/outputTargetForElement.tests.html similarity index 100% rename from web/src/test/auto/dom/cases/attachment/outputTargetForElement.spec.html rename to web/src/test/auto/dom/cases/attachment/outputTargetForElement.tests.html diff --git a/web/src/test/auto/dom/cases/attachment/pageContextAttachment.spec.ts b/web/src/test/auto/dom/cases/attachment/pageContextAttachment.test.ts similarity index 100% rename from web/src/test/auto/dom/cases/attachment/pageContextAttachment.spec.ts rename to web/src/test/auto/dom/cases/attachment/pageContextAttachment.test.ts diff --git a/web/src/test/auto/dom/cases/browser/contextManager.spec.ts b/web/src/test/auto/dom/cases/browser/contextManager.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/browser/contextManager.spec.ts rename to web/src/test/auto/dom/cases/browser/contextManager.tests.ts diff --git a/web/src/test/auto/dom/cases/dom-utils/cookies.spec.ts b/web/src/test/auto/dom/cases/dom-utils/cookies.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/dom-utils/cookies.spec.ts rename to web/src/test/auto/dom/cases/dom-utils/cookies.tests.ts diff --git a/web/src/test/auto/dom/cases/element-wrappers/element_interfaces.spec.ts b/web/src/test/auto/dom/cases/element-wrappers/element_interfaces.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/element-wrappers/element_interfaces.spec.ts rename to web/src/test/auto/dom/cases/element-wrappers/element_interfaces.tests.ts diff --git a/web/src/test/auto/dom/cases/element-wrappers/target_mocks.spec.ts b/web/src/test/auto/dom/cases/element-wrappers/target_mocks.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/element-wrappers/target_mocks.spec.ts rename to web/src/test/auto/dom/cases/element-wrappers/target_mocks.tests.ts diff --git a/web/src/test/auto/dom/cases/gesture-processor/canary.spec.ts b/web/src/test/auto/dom/cases/gesture-processor/canary.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/gesture-processor/canary.spec.ts rename to web/src/test/auto/dom/cases/gesture-processor/canary.tests.ts diff --git a/web/src/test/auto/dom/cases/gesture-processor/host-page.spec.html b/web/src/test/auto/dom/cases/gesture-processor/host-page.tests.html similarity index 92% rename from web/src/test/auto/dom/cases/gesture-processor/host-page.spec.html rename to web/src/test/auto/dom/cases/gesture-processor/host-page.tests.html index ce3aae6c48..cc83c5e6ef 100644 --- a/web/src/test/auto/dom/cases/gesture-processor/host-page.spec.html +++ b/web/src/test/auto/dom/cases/gesture-processor/host-page.tests.html @@ -18,9 +18,9 @@ import { runTests } from '@web/test-runner-mocha'; runTests(async() => { - await import('./canary.spec.ts'); - await import('./ignoredInputs.spec.ts'); - await import('./recordedCoordSequences.spec.ts'); + await import('./canary.tests.ts'); + await import('./ignoredInputs.tests.ts'); + await import('./recordedCoordSequences.tests.ts'); }); diff --git a/web/src/test/auto/dom/cases/gesture-processor/ignoredInputs.spec.ts b/web/src/test/auto/dom/cases/gesture-processor/ignoredInputs.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/gesture-processor/ignoredInputs.spec.ts rename to web/src/test/auto/dom/cases/gesture-processor/ignoredInputs.tests.ts diff --git a/web/src/test/auto/dom/cases/gesture-processor/recordedCoordSequences.spec.ts b/web/src/test/auto/dom/cases/gesture-processor/recordedCoordSequences.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/gesture-processor/recordedCoordSequences.spec.ts rename to web/src/test/auto/dom/cases/gesture-processor/recordedCoordSequences.tests.ts diff --git a/web/src/test/auto/dom/cases/keyboard-storage/cloudQueries.spec.ts b/web/src/test/auto/dom/cases/keyboard-storage/cloudQueries.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/keyboard-storage/cloudQueries.spec.ts rename to web/src/test/auto/dom/cases/keyboard-storage/cloudQueries.tests.ts diff --git a/web/src/test/auto/dom/cases/keyboard-storage/domCloudRequester.spec.ts b/web/src/test/auto/dom/cases/keyboard-storage/domCloudRequester.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/keyboard-storage/domCloudRequester.spec.ts rename to web/src/test/auto/dom/cases/keyboard-storage/domCloudRequester.tests.ts diff --git a/web/src/test/auto/dom/cases/keyboard-storage/keyboardRequisitioner.spec.ts b/web/src/test/auto/dom/cases/keyboard-storage/keyboardRequisitioner.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/keyboard-storage/keyboardRequisitioner.spec.ts rename to web/src/test/auto/dom/cases/keyboard-storage/keyboardRequisitioner.tests.ts diff --git a/web/src/test/auto/dom/cases/keyboard/domKeyboardLoader.spec.ts b/web/src/test/auto/dom/cases/keyboard/domKeyboardLoader.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/keyboard/domKeyboardLoader.spec.ts rename to web/src/test/auto/dom/cases/keyboard/domKeyboardLoader.tests.ts diff --git a/web/src/test/auto/dom/cases/osk/activation.spec.ts b/web/src/test/auto/dom/cases/osk/activation.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/osk/activation.spec.ts rename to web/src/test/auto/dom/cases/osk/activation.tests.ts diff --git a/web/src/test/auto/dom/cases/osk/events.spec.ts b/web/src/test/auto/dom/cases/osk/events.tests.ts similarity index 100% rename from web/src/test/auto/dom/cases/osk/events.spec.ts rename to web/src/test/auto/dom/cases/osk/events.tests.ts diff --git a/web/src/test/auto/dom/test_init_check.spec.ts b/web/src/test/auto/dom/init_check.tests.ts similarity index 100% rename from web/src/test/auto/dom/test_init_check.spec.ts rename to web/src/test/auto/dom/init_check.tests.ts diff --git a/web/src/test/auto/dom/web-test-runner.config.mjs b/web/src/test/auto/dom/web-test-runner.config.mjs index 3050837cd5..701eab15a7 100644 --- a/web/src/test/auto/dom/web-test-runner.config.mjs +++ b/web/src/test/auto/dom/web-test-runner.config.mjs @@ -33,53 +33,53 @@ export default { nodeResolve: true, // Top-level, implicit 'default' group files: [ - 'src/test/auto/dom/test_init_check.spec.ts', - // '**/*.spec.html' + 'src/test/auto/dom/init_check.tests.ts', + // '**/*.tests.html' ], groups: [ { name: 'engine/attachment', // Relative, from the containing package.json files: [ - 'build/test/dom/cases/attachment/**/*.spec.html', - 'build/test/dom/cases/attachment/**/*.spec.mjs' + 'build/test/dom/cases/attachment/**/*.tests.html', + 'build/test/dom/cases/attachment/**/*.tests.mjs' ] }, { name: 'app/browser', // Relative, from the containing package.json - files: ['build/test/dom/cases/browser/**/*.spec.mjs'] + files: ['build/test/dom/cases/browser/**/*.tests.mjs'] }, { name: 'engine/dom-utils', // Relative, from the containing package.json - files: ['build/test/dom/cases/dom-utils/**/*.spec.mjs'] + files: ['build/test/dom/cases/dom-utils/**/*.tests.mjs'] }, { name: 'engine/element-wrappers', // Relative, from the containing package.json - files: ['build/test/dom/cases/element-wrappers/**/*.spec.mjs'] + files: ['build/test/dom/cases/element-wrappers/**/*.tests.mjs'] }, { name: 'engine/gesture-processor', // Relative, from the containing package.json - // Note: here we use the .spec.html file in the src directory! - files: ['src/test/auto/dom/cases/gesture-processor/**/*.spec.html'] + // Note: here we use the .tests.html file in the src directory! + files: ['src/test/auto/dom/cases/gesture-processor/**/*.tests.html'] }, { name: 'engine/keyboard', // Relative, from the containing package.json - files: ['build/test/dom/cases/keyboard/**/*.spec.mjs'] + files: ['build/test/dom/cases/keyboard/**/*.tests.mjs'] }, { name: 'engine/keyboard-storage', // Relative, from the containing package.json - files: ['build/test/dom/cases/keyboard-storage/**/*.spec.mjs'] + files: ['build/test/dom/cases/keyboard-storage/**/*.tests.mjs'] }, { name: 'engine/osk', // Relative, from the containing package.json - files: ['build/test/dom/cases/osk/**/*.spec.mjs'] + files: ['build/test/dom/cases/osk/**/*.tests.mjs'] } ], middleware: [ diff --git a/web/src/test/auto/headless/engine/events/emitterListenerSpy.js b/web/src/test/auto/headless/engine/events/emitterListenerSpy.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/events/emitterListenerSpy.js rename to web/src/test/auto/headless/engine/events/emitterListenerSpy.tests.js diff --git a/web/src/test/auto/headless/engine/events/legacyEventEmitter.js b/web/src/test/auto/headless/engine/events/legacyEventEmitter.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/events/legacyEventEmitter.js rename to web/src/test/auto/headless/engine/events/legacyEventEmitter.tests.js diff --git a/web/src/test/auto/headless/engine/interfaces/pathConfiguration.js b/web/src/test/auto/headless/engine/interfaces/pathConfiguration.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/interfaces/pathConfiguration.js rename to web/src/test/auto/headless/engine/interfaces/pathConfiguration.tests.js diff --git a/web/src/test/auto/headless/engine/interfaces/prediction/predictionContext.spec.js b/web/src/test/auto/headless/engine/interfaces/prediction/predictionContext.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/interfaces/prediction/predictionContext.spec.js rename to web/src/test/auto/headless/engine/interfaces/prediction/predictionContext.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/basic-engine.js b/web/src/test/auto/headless/engine/js-processor/basic-engine.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/basic-engine.js rename to web/src/test/auto/headless/engine/js-processor/basic-engine.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/basic-init.js b/web/src/test/auto/headless/engine/js-processor/basic-init.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/basic-init.js rename to web/src/test/auto/headless/engine/js-processor/basic-init.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/bundled-module.js b/web/src/test/auto/headless/engine/js-processor/bundled-module.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/bundled-module.js rename to web/src/test/auto/headless/engine/js-processor/bundled-module.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/chirality.js b/web/src/test/auto/headless/engine/js-processor/chirality.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/chirality.js rename to web/src/test/auto/headless/engine/js-processor/chirality.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/deadkeys.js b/web/src/test/auto/headless/engine/js-processor/deadkeys.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/deadkeys.js rename to web/src/test/auto/headless/engine/js-processor/deadkeys.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/engine/context.js b/web/src/test/auto/headless/engine/js-processor/engine/context.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/engine/context.js rename to web/src/test/auto/headless/engine/js-processor/engine/context.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/engine/notany_context.js b/web/src/test/auto/headless/engine/js-processor/engine/notany_context.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/engine/notany_context.js rename to web/src/test/auto/headless/engine/js-processor/engine/notany_context.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/engine/stores.js b/web/src/test/auto/headless/engine/js-processor/engine/stores.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/engine/stores.js rename to web/src/test/auto/headless/engine/js-processor/engine/stores.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/engine/unmatched_final_group.js b/web/src/test/auto/headless/engine/js-processor/engine/unmatched_final_group.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/engine/unmatched_final_group.js rename to web/src/test/auto/headless/engine/js-processor/engine/unmatched_final_group.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/mocks.js b/web/src/test/auto/headless/engine/js-processor/mocks.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/mocks.js rename to web/src/test/auto/headless/engine/js-processor/mocks.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/non-positional-rules.js b/web/src/test/auto/headless/engine/js-processor/non-positional-rules.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/non-positional-rules.js rename to web/src/test/auto/headless/engine/js-processor/non-positional-rules.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/specialized-backspace.js b/web/src/test/auto/headless/engine/js-processor/specialized-backspace.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/specialized-backspace.js rename to web/src/test/auto/headless/engine/js-processor/specialized-backspace.tests.js diff --git a/web/src/test/auto/headless/engine/js-processor/transcriptions.js b/web/src/test/auto/headless/engine/js-processor/transcriptions.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/js-processor/transcriptions.js rename to web/src/test/auto/headless/engine/js-processor/transcriptions.tests.js diff --git a/web/src/test/auto/headless/engine/keyboard-storage/cloudQueries.js b/web/src/test/auto/headless/engine/keyboard-storage/cloudQueries.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/keyboard-storage/cloudQueries.js rename to web/src/test/auto/headless/engine/keyboard-storage/cloudQueries.tests.js diff --git a/web/src/test/auto/headless/engine/keyboard-storage/keyboardRequisitioner.js b/web/src/test/auto/headless/engine/keyboard-storage/keyboardRequisitioner.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/keyboard-storage/keyboardRequisitioner.js rename to web/src/test/auto/headless/engine/keyboard-storage/keyboardRequisitioner.tests.js diff --git a/web/src/test/auto/headless/engine/keyboard-storage/keyboardStub.js b/web/src/test/auto/headless/engine/keyboard-storage/keyboardStub.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/keyboard-storage/keyboardStub.js rename to web/src/test/auto/headless/engine/keyboard-storage/keyboardStub.tests.js diff --git a/web/src/test/auto/headless/engine/keyboard-storage/nodeCloudRequester.js b/web/src/test/auto/headless/engine/keyboard-storage/nodeCloudRequester.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/keyboard-storage/nodeCloudRequester.js rename to web/src/test/auto/headless/engine/keyboard-storage/nodeCloudRequester.tests.js diff --git a/web/src/test/auto/headless/engine/keyboard-storage/stubAndKeyboardCache.js b/web/src/test/auto/headless/engine/keyboard-storage/stubAndKeyboardCache.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/keyboard-storage/stubAndKeyboardCache.js rename to web/src/test/auto/headless/engine/keyboard-storage/stubAndKeyboardCache.tests.js diff --git a/web/src/test/auto/headless/engine/keyboard/keyboard-loading.js b/web/src/test/auto/headless/engine/keyboard/keyboard-loading.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/keyboard/keyboard-loading.js rename to web/src/test/auto/headless/engine/keyboard/keyboard-loading.tests.js diff --git a/web/src/test/auto/headless/engine/keyboard/keyboard-properties.js b/web/src/test/auto/headless/engine/keyboard/keyboard-properties.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/keyboard/keyboard-properties.js rename to web/src/test/auto/headless/engine/keyboard/keyboard-properties.tests.js diff --git a/web/src/test/auto/headless/engine/main/headless/inputProcessor.spec.js b/web/src/test/auto/headless/engine/main/headless/inputProcessor.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/main/headless/inputProcessor.spec.js rename to web/src/test/auto/headless/engine/main/headless/inputProcessor.tests.js diff --git a/web/src/test/auto/headless/engine/main/headless/languageProcessor.spec.js b/web/src/test/auto/headless/engine/main/headless/languageProcessor.tests.js similarity index 100% rename from web/src/test/auto/headless/engine/main/headless/languageProcessor.spec.js rename to web/src/test/auto/headless/engine/main/headless/languageProcessor.tests.js diff --git a/web/src/test/auto/integrated/cases/basics.spec.ts b/web/src/test/auto/integrated/cases/basics.tests.ts similarity index 100% rename from web/src/test/auto/integrated/cases/basics.spec.ts rename to web/src/test/auto/integrated/cases/basics.tests.ts diff --git a/web/src/test/auto/integrated/cases/engine.spec.ts b/web/src/test/auto/integrated/cases/engine.tests.ts similarity index 100% rename from web/src/test/auto/integrated/cases/engine.spec.ts rename to web/src/test/auto/integrated/cases/engine.tests.ts diff --git a/web/src/test/auto/integrated/cases/engine_chirality.spec.ts b/web/src/test/auto/integrated/cases/engine_chirality.tests.ts similarity index 100% rename from web/src/test/auto/integrated/cases/engine_chirality.spec.ts rename to web/src/test/auto/integrated/cases/engine_chirality.tests.ts diff --git a/web/src/test/auto/integrated/cases/events.spec.ts b/web/src/test/auto/integrated/cases/events.tests.ts similarity index 100% rename from web/src/test/auto/integrated/cases/events.spec.ts rename to web/src/test/auto/integrated/cases/events.tests.ts diff --git a/web/src/test/auto/integrated/cases/text_selection.spec.ts b/web/src/test/auto/integrated/cases/text_selection.tests.ts similarity index 100% rename from web/src/test/auto/integrated/cases/text_selection.spec.ts rename to web/src/test/auto/integrated/cases/text_selection.tests.ts diff --git a/web/src/test/auto/integrated/test_init_check.spec.ts b/web/src/test/auto/integrated/init_check.tests.ts similarity index 100% rename from web/src/test/auto/integrated/test_init_check.spec.ts rename to web/src/test/auto/integrated/init_check.tests.ts diff --git a/web/src/test/auto/integrated/web-test-runner.config.mjs b/web/src/test/auto/integrated/web-test-runner.config.mjs index 1637ea82d6..8d937f55af 100644 --- a/web/src/test/auto/integrated/web-test-runner.config.mjs +++ b/web/src/test/auto/integrated/web-test-runner.config.mjs @@ -17,15 +17,15 @@ export default { new LauncherWrapper(playwrightLauncher({ product: 'firefox' })), // Setting it higher makes things faster... but Webkit experiences stability // issues for some of the tests if this is set higher than 1. Notably, - // engine.spec.mjs, events.spec.mjs, and text_selection.spec.mjs. All the + // engine.tests.mjs, events.tests.mjs, and text_selection.tests.mjs. All the // text-simulation ones. new LauncherWrapper(playwrightLauncher({ product: 'webkit', concurrency: 1})) ], concurrency: 10, nodeResolve: true, files: [ - 'build/test/integrated//**/*.spec.mjs', - // '**/*.spec.html' + 'build/test/integrated//**/*.tests.mjs', + // '**/*.tests.html' ], middleware: [ // Rewrites short-hand paths for test resources, making them fully relative to the repo root. From 718881a027eea8479b94d4376196eeca9b884ea8 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 26 Nov 2024 17:46:59 +0100 Subject: [PATCH 06/22] chore(core): rename test files This change rename the test files for Core according to the discussion at the Keyman conference in November 2024. --- .../{action_api.cpp => action_api.tests.cpp} | 0 ...n_set_api.cpp => action_set_api.tests.cpp} | 0 ..._get_api.cpp => actions_get_api.tests.cpp} | 0 ...malize.cpp => actions_normalize.tests.cpp} | 0 ...{context_api.cpp => context_api.tests.cpp} | 0 .../{debug_api.cpp => debug_api.tests.cpp} | 0 ...eyboard_api.cpp => keyboard_api.tests.cpp} | 0 ..._kmx_context.cpp => kmx_context.tests.cpp} | 0 ..._kmx_xstring.cpp => kmx_xstring.tests.cpp} | 0 core/tests/unit/kmnkbd/meson.build | 24 ++++++++--------- ...{options_api.cpp => options_api.tests.cpp} | 0 .../{state_api.cpp => state_api.tests.cpp} | 0 ...xt_api.cpp => state_context_api.tests.cpp} | 0 ...event.cpp => kmx_external_event.tests.cpp} | 0 .../kmx/{kmx_imx.cpp => kmx_imx.tests.cpp} | 0 ...mx_key_list.cpp => kmx_key_list.tests.cpp} | 0 core/tests/unit/kmx/meson.build | 6 ++--- ...on.cpp => context_normalization.tests.cpp} | 0 ...e_ldml_min.cpp => core_ldml_min.tests.cpp} | 0 .../{test_kmx_plus.cpp => kmx_plus.tests.cpp} | 0 core/tests/unit/ldml/meson.build | 26 +++++++++---------- ...st_transforms.cpp => transforms.tests.cpp} | 0 .../{test_unicode.cpp => unicode.tests.cpp} | 0 core/tests/unit/utftest/meson.build | 2 +- .../{utftest.cpp => utftest.tests.cpp} | 0 25 files changed, 29 insertions(+), 29 deletions(-) rename core/tests/unit/kmnkbd/{action_api.cpp => action_api.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{action_set_api.cpp => action_set_api.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{test_actions_get_api.cpp => actions_get_api.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{test_actions_normalize.cpp => actions_normalize.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{context_api.cpp => context_api.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{debug_api.cpp => debug_api.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{keyboard_api.cpp => keyboard_api.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{test_kmx_context.cpp => kmx_context.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{test_kmx_xstring.cpp => kmx_xstring.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{options_api.cpp => options_api.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{state_api.cpp => state_api.tests.cpp} (100%) rename core/tests/unit/kmnkbd/{state_context_api.cpp => state_context_api.tests.cpp} (100%) rename core/tests/unit/kmx/{kmx_external_event.cpp => kmx_external_event.tests.cpp} (100%) rename core/tests/unit/kmx/{kmx_imx.cpp => kmx_imx.tests.cpp} (100%) rename core/tests/unit/kmx/{kmx_key_list.cpp => kmx_key_list.tests.cpp} (100%) rename core/tests/unit/ldml/{test_context_normalization.cpp => context_normalization.tests.cpp} (100%) rename core/tests/unit/ldml/{core_ldml_min.cpp => core_ldml_min.tests.cpp} (100%) rename core/tests/unit/ldml/{test_kmx_plus.cpp => kmx_plus.tests.cpp} (100%) rename core/tests/unit/ldml/{test_transforms.cpp => transforms.tests.cpp} (100%) rename core/tests/unit/ldml/{test_unicode.cpp => unicode.tests.cpp} (100%) rename core/tests/unit/utftest/{utftest.cpp => utftest.tests.cpp} (100%) diff --git a/core/tests/unit/kmnkbd/action_api.cpp b/core/tests/unit/kmnkbd/action_api.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/action_api.cpp rename to core/tests/unit/kmnkbd/action_api.tests.cpp diff --git a/core/tests/unit/kmnkbd/action_set_api.cpp b/core/tests/unit/kmnkbd/action_set_api.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/action_set_api.cpp rename to core/tests/unit/kmnkbd/action_set_api.tests.cpp diff --git a/core/tests/unit/kmnkbd/test_actions_get_api.cpp b/core/tests/unit/kmnkbd/actions_get_api.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/test_actions_get_api.cpp rename to core/tests/unit/kmnkbd/actions_get_api.tests.cpp diff --git a/core/tests/unit/kmnkbd/test_actions_normalize.cpp b/core/tests/unit/kmnkbd/actions_normalize.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/test_actions_normalize.cpp rename to core/tests/unit/kmnkbd/actions_normalize.tests.cpp diff --git a/core/tests/unit/kmnkbd/context_api.cpp b/core/tests/unit/kmnkbd/context_api.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/context_api.cpp rename to core/tests/unit/kmnkbd/context_api.tests.cpp diff --git a/core/tests/unit/kmnkbd/debug_api.cpp b/core/tests/unit/kmnkbd/debug_api.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/debug_api.cpp rename to core/tests/unit/kmnkbd/debug_api.tests.cpp diff --git a/core/tests/unit/kmnkbd/keyboard_api.cpp b/core/tests/unit/kmnkbd/keyboard_api.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/keyboard_api.cpp rename to core/tests/unit/kmnkbd/keyboard_api.tests.cpp diff --git a/core/tests/unit/kmnkbd/test_kmx_context.cpp b/core/tests/unit/kmnkbd/kmx_context.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/test_kmx_context.cpp rename to core/tests/unit/kmnkbd/kmx_context.tests.cpp diff --git a/core/tests/unit/kmnkbd/test_kmx_xstring.cpp b/core/tests/unit/kmnkbd/kmx_xstring.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/test_kmx_xstring.cpp rename to core/tests/unit/kmnkbd/kmx_xstring.tests.cpp diff --git a/core/tests/unit/kmnkbd/meson.build b/core/tests/unit/kmnkbd/meson.build index 7285b9bf11..c108ae5b83 100644 --- a/core/tests/unit/kmnkbd/meson.build +++ b/core/tests/unit/kmnkbd/meson.build @@ -16,18 +16,18 @@ endif local_defns = ['-DKM_CORE_LIBRARY_STATIC'] tests = [ - ['action-api', 'action_api.cpp'], - ['action-set-api', 'action_set_api.cpp'], - ['context-api', 'context_api.cpp'], - ['keyboard-api', 'keyboard_api.cpp'], - ['options-api', 'options_api.cpp'], - ['state-api', 'state_api.cpp'], - ['state-context-api', 'state_context_api.cpp'], - ['debug-api', 'debug_api.cpp'], - ['kmx_xstring', 'test_kmx_xstring.cpp'], - ['kmx_context', 'test_kmx_context.cpp'], - ['test_actions_normalize', 'test_actions_normalize.cpp'], - ['test_actions_get_api', 'test_actions_get_api.cpp'], + ['action-api-tests', 'action_api.tests.cpp'], + ['action-set-api-tests', 'action_set_api.tests.cpp'], + ['context-api-tests', 'context_api.tests.cpp'], + ['keyboard-api-tests', 'keyboard_api.tests.cpp'], + ['options-api-tests', 'options_api.tests.cpp'], + ['state-api-tests', 'state_api.tests.cpp'], + ['state-context-api-tests', 'state_context_api.tests.cpp'], + ['debug-api-tests', 'debug_api.tests.cpp'], + ['kmx_xstring-tests', 'kmx_xstring.tests.cpp'], + ['kmx_context-tests', 'kmx_context.tests.cpp'], + ['actions_normalize-tests', 'actions_normalize.tests.cpp'], + ['actions_get_api-tests', 'actions_get_api.tests.cpp'], ] test_path = join_paths(meson.current_build_dir(), '..', 'kmx') diff --git a/core/tests/unit/kmnkbd/options_api.cpp b/core/tests/unit/kmnkbd/options_api.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/options_api.cpp rename to core/tests/unit/kmnkbd/options_api.tests.cpp diff --git a/core/tests/unit/kmnkbd/state_api.cpp b/core/tests/unit/kmnkbd/state_api.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/state_api.cpp rename to core/tests/unit/kmnkbd/state_api.tests.cpp diff --git a/core/tests/unit/kmnkbd/state_context_api.cpp b/core/tests/unit/kmnkbd/state_context_api.tests.cpp similarity index 100% rename from core/tests/unit/kmnkbd/state_context_api.cpp rename to core/tests/unit/kmnkbd/state_context_api.tests.cpp diff --git a/core/tests/unit/kmx/kmx_external_event.cpp b/core/tests/unit/kmx/kmx_external_event.tests.cpp similarity index 100% rename from core/tests/unit/kmx/kmx_external_event.cpp rename to core/tests/unit/kmx/kmx_external_event.tests.cpp diff --git a/core/tests/unit/kmx/kmx_imx.cpp b/core/tests/unit/kmx/kmx_imx.tests.cpp similarity index 100% rename from core/tests/unit/kmx/kmx_imx.cpp rename to core/tests/unit/kmx/kmx_imx.tests.cpp diff --git a/core/tests/unit/kmx/kmx_key_list.cpp b/core/tests/unit/kmx/kmx_key_list.tests.cpp similarity index 100% rename from core/tests/unit/kmx/kmx_key_list.cpp rename to core/tests/unit/kmx/kmx_key_list.tests.cpp diff --git a/core/tests/unit/kmx/meson.build b/core/tests/unit/kmx/meson.build index 548ab89522..a7a69079e4 100644 --- a/core/tests/unit/kmx/meson.build +++ b/core/tests/unit/kmx/meson.build @@ -174,7 +174,7 @@ subdir('fixtures') # should work for Linux, macOS, and WASM. test_path = source_path -key_e = executable('key_list', ['kmx_key_list.cpp', common_test_files], +key_e = executable('key_list_tests', ['kmx_key_list.tests.cpp', common_test_files], cpp_args: defns + warns, include_directories: [inc, libsrc], link_args: links + tests_flags, @@ -193,7 +193,7 @@ test('key_list', key_e, depends: kbd_log, args: [kbd_obj] ) # test for imx list -imx_e = executable('imx_list', ['kmx_imx.cpp', common_test_files], +imx_e = executable('imx_list_tests', ['kmx_imx.tests.cpp', common_test_files], cpp_args: defns + warns, include_directories: [inc, libsrc], link_args: links + tests_flags, @@ -211,7 +211,7 @@ kbd_log = custom_target(test_kbd + '.kmx'.underscorify(), ) test('imx_list', imx_e, depends: kbd_log, args: [kbd_obj] ) -external_e = executable('ext_event', ['kmx_external_event.cpp', common_test_files], +external_e = executable('ext_event_tests', ['kmx_external_event.tests.cpp', common_test_files], cpp_args: defns + warns, include_directories: [inc, libsrc], link_args: links + tests_flags, diff --git a/core/tests/unit/ldml/test_context_normalization.cpp b/core/tests/unit/ldml/context_normalization.tests.cpp similarity index 100% rename from core/tests/unit/ldml/test_context_normalization.cpp rename to core/tests/unit/ldml/context_normalization.tests.cpp diff --git a/core/tests/unit/ldml/core_ldml_min.cpp b/core/tests/unit/ldml/core_ldml_min.tests.cpp similarity index 100% rename from core/tests/unit/ldml/core_ldml_min.cpp rename to core/tests/unit/ldml/core_ldml_min.tests.cpp diff --git a/core/tests/unit/ldml/test_kmx_plus.cpp b/core/tests/unit/ldml/kmx_plus.tests.cpp similarity index 100% rename from core/tests/unit/ldml/test_kmx_plus.cpp rename to core/tests/unit/ldml/kmx_plus.tests.cpp diff --git a/core/tests/unit/ldml/meson.build b/core/tests/unit/ldml/meson.build index 20ad621b50..f46b08b4b3 100644 --- a/core/tests/unit/ldml/meson.build +++ b/core/tests/unit/ldml/meson.build @@ -82,8 +82,8 @@ ldml = executable('ldml', objects: lib.extract_all_objects(recursive: false), ) -core_ldml_min = executable('core_ldml_min', - ['core_ldml_min.cpp'], +core_ldml_min = executable('core_ldml_min_tests', + ['core_ldml_min.tests.cpp'], cpp_args: defns + warns, include_directories: [inc, libsrc], link_args: links, @@ -91,12 +91,12 @@ core_ldml_min = executable('core_ldml_min', link_with: [lib], # objects: lib.extract_all_objects(recursive: false), ) -test('core_ldml_min', core_ldml_min, suite: 'ldml', should_fail: true) +test('core_ldml_min_tests', core_ldml_min, suite: 'ldml', should_fail: true) # Build and run additional test_kmx_plus test -e = executable('test_kmx_plus', 'test_kmx_plus.cpp', +e = executable('kmx_plus_tests', 'kmx_plus.tests.cpp', 'ldml_test_utils.cpp', common_test_files, cpp_args: defns + warns, @@ -104,18 +104,18 @@ e = executable('test_kmx_plus', 'test_kmx_plus.cpp', link_args: links + tests_flags, dependencies: [icu_uc, icu_i18n], objects: lib.extract_all_objects(recursive: false)) -test('test_kmx_plus', e, suite: 'ldml') +test('kmx_plus_tests', e, suite: 'ldml') # run transforms / ldml utilities unit test -t = executable('test_transforms', 'test_transforms.cpp', +t = executable('transforms_tests', 'transforms.tests.cpp', common_test_files, cpp_args: defns + warns, include_directories: [inc, libsrc, '../../../../developer/src/ext/json'], link_args: links + tests_flags, dependencies: [icu_uc, icu_i18n], objects: lib.extract_all_objects(recursive: false)) -test('test_transforms', t, suite: 'ldml') +test('transforms_tests', t, suite: 'ldml') # run test_context_normalization ldml unit test @@ -125,19 +125,19 @@ if cpp_compiler.get_id() == 'emscripten' normalization_tests_flags += ['-lnodefs.js', wasm_exported_runtime_methods] endif -test_context_normalization = executable('test_context_normalization', - ['test_context_normalization.cpp', common_test_files], +test_context_normalization = executable('context_normalization_tests', + ['context_normalization.tests.cpp', common_test_files], cpp_args: defns + warns, include_directories: [inc, libsrc, '../../../../developer/src/ext/json'], link_args: links + normalization_tests_flags, dependencies: [icu_uc, icu_i18n], objects: lib.extract_all_objects(recursive: false)) -test('test_context_normalization', test_context_normalization, suite: 'ldml') +test('context_normalization_tests', test_context_normalization, suite: 'ldml') # Build and run additional test_unicode test -test_unicode = executable('test_unicode', 'test_unicode.cpp', - ['test_unicode.cpp', common_test_files, generated_headers], +test_unicode = executable('unicode_tests', 'unicode.tests.cpp', + ['unicode.tests.cpp', common_test_files, generated_headers], cpp_args: defns + warns, include_directories: [inc, libsrc, '../../../../developer/src/ext/json'], link_args: links + tests_flags, @@ -146,7 +146,7 @@ test_unicode = executable('test_unicode', 'test_unicode.cpp', ) -test('test_unicode', test_unicode, suite: 'ldml', +test('unicode_tests', test_unicode, suite: 'ldml', args: [ test_unicode_path / 'nodeversions.json', test_unicode_path / 'package.json', diff --git a/core/tests/unit/ldml/test_transforms.cpp b/core/tests/unit/ldml/transforms.tests.cpp similarity index 100% rename from core/tests/unit/ldml/test_transforms.cpp rename to core/tests/unit/ldml/transforms.tests.cpp diff --git a/core/tests/unit/ldml/test_unicode.cpp b/core/tests/unit/ldml/unicode.tests.cpp similarity index 100% rename from core/tests/unit/ldml/test_unicode.cpp rename to core/tests/unit/ldml/unicode.tests.cpp diff --git a/core/tests/unit/utftest/meson.build b/core/tests/unit/utftest/meson.build index 4ab6cb74ca..c82b6f98c5 100644 --- a/core/tests/unit/utftest/meson.build +++ b/core/tests/unit/utftest/meson.build @@ -4,7 +4,7 @@ # Authors: Tim Eves (TSE) # -e = executable('utftest', 'utftest.cpp', +e = executable('utftest', 'utftest.tests.cpp', objects: lib.extract_objects('../../common/cpp/utfcodec.cpp'), include_directories: [libsrc]) test('utftest', e) diff --git a/core/tests/unit/utftest/utftest.cpp b/core/tests/unit/utftest/utftest.tests.cpp similarity index 100% rename from core/tests/unit/utftest/utftest.cpp rename to core/tests/unit/utftest/utftest.tests.cpp From 4a852c9522b60becca122856372a08b0352b732c Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 26 Nov 2024 17:56:04 +0100 Subject: [PATCH 07/22] chore(linux): rename test files This change rename the test files for Linux according to the discussion at the Keyman conference in November 2024. Python is pretty opinionated about the naming of files, so we have to use `*_tests.py` as test filename instead of the usual `*.tests.py`. --- linux/.gitignore | 2 +- .../test/{bcp47util_tests.c => bcp47util.tests.c} | 0 .../test/{keymanutil_tests.c => keymanutil.tests.c} | 0 linux/ibus-keyman/src/test/meson.build | 4 ++-- linux/keyman-config/run-tests.sh | 12 ++++++------ .../tests/{test_bcp47tag.py => bcp47tag_tests.py} | 0 ...ils.py => canonical_language_code_utils_tests.py} | 0 ...custom_keyboards.py => custom_keyboards_tests.py} | 0 .../{test_dconf_util.py => dconf_util_tests.py} | 0 .../tests/{test_get_kmp.py => get_kmp_tests.py} | 0 ...yboards_util.py => gnome_keyboards_util_tests.py} | 0 .../tests/{test_gsettings.py => gsettings_tests.py} | 0 ...est_handle_install.py => handle_install_tests.py} | 0 .../tests/{test_ibus_util.py => ibus_util_tests.py} | 0 .../{test_install_kmp.py => install_kmp_tests.py} | 0 .../tests/{test_kvk2ldml.py => kvk2ldml_tests.py} | 0 ...{test_lang_tags_map.py => lang_tags_map_tests.py} | 0 ...letion.py => package_install_completion_tests.py} | 0 ...{test_uninstall_kmp.py => uninstall_kmp_tests.py} | 0 19 files changed, 9 insertions(+), 9 deletions(-) rename linux/ibus-keyman/src/test/{bcp47util_tests.c => bcp47util.tests.c} (100%) rename linux/ibus-keyman/src/test/{keymanutil_tests.c => keymanutil.tests.c} (100%) rename linux/keyman-config/tests/{test_bcp47tag.py => bcp47tag_tests.py} (100%) rename linux/keyman-config/tests/{test_canonical_language_code_utils.py => canonical_language_code_utils_tests.py} (100%) rename linux/keyman-config/tests/{test_custom_keyboards.py => custom_keyboards_tests.py} (100%) rename linux/keyman-config/tests/{test_dconf_util.py => dconf_util_tests.py} (100%) rename linux/keyman-config/tests/{test_get_kmp.py => get_kmp_tests.py} (100%) rename linux/keyman-config/tests/{test_gnome_keyboards_util.py => gnome_keyboards_util_tests.py} (100%) rename linux/keyman-config/tests/{test_gsettings.py => gsettings_tests.py} (100%) rename linux/keyman-config/tests/{test_handle_install.py => handle_install_tests.py} (100%) rename linux/keyman-config/tests/{test_ibus_util.py => ibus_util_tests.py} (100%) rename linux/keyman-config/tests/{test_install_kmp.py => install_kmp_tests.py} (100%) rename linux/keyman-config/tests/{test_kvk2ldml.py => kvk2ldml_tests.py} (100%) rename linux/keyman-config/tests/{test_lang_tags_map.py => lang_tags_map_tests.py} (100%) rename linux/keyman-config/tests/{test_package_install_completion.py => package_install_completion_tests.py} (100%) rename linux/keyman-config/tests/{test_uninstall_kmp.py => uninstall_kmp_tests.py} (100%) diff --git a/linux/.gitignore b/linux/.gitignore index f85acc0f35..a67e991b30 100644 --- a/linux/.gitignore +++ b/linux/.gitignore @@ -31,7 +31,7 @@ debianpackage/ *.tar.xz *.tar.gz *.dsc -help/reference/ +docs/help/reference/ # Cached/auto-compiled Python bytecode *.pyc diff --git a/linux/ibus-keyman/src/test/bcp47util_tests.c b/linux/ibus-keyman/src/test/bcp47util.tests.c similarity index 100% rename from linux/ibus-keyman/src/test/bcp47util_tests.c rename to linux/ibus-keyman/src/test/bcp47util.tests.c diff --git a/linux/ibus-keyman/src/test/keymanutil_tests.c b/linux/ibus-keyman/src/test/keymanutil.tests.c similarity index 100% rename from linux/ibus-keyman/src/test/keymanutil_tests.c rename to linux/ibus-keyman/src/test/keymanutil.tests.c diff --git a/linux/ibus-keyman/src/test/meson.build b/linux/ibus-keyman/src/test/meson.build index 333f05c212..f1f34a63c5 100644 --- a/linux/ibus-keyman/src/test/meson.build +++ b/linux/ibus-keyman/src/test/meson.build @@ -1,5 +1,5 @@ keymanutil_sources = [ - 'keymanutil_tests.c', + 'keymanutil.tests.c', util_files, ] @@ -55,7 +55,7 @@ print_kmp_test = executable( bcp47_util_tests = executable( 'bcp47-util-tests', sources: [ - 'bcp47util_tests.c', + 'bcp47util.tests.c', '../bcp47util.c' ], dependencies: [ gtk, icu ], diff --git a/linux/keyman-config/run-tests.sh b/linux/keyman-config/run-tests.sh index de99c55e8f..41904e4cf3 100755 --- a/linux/keyman-config/run-tests.sh +++ b/linux/keyman-config/run-tests.sh @@ -1,18 +1,18 @@ #!/bin/bash -PYTHONPATH=.:$PYTHONPATH +PYTHONPATH=.:${PYTHONPATH} XDG_CONFIG_HOME=$(mktemp --directory) export XDG_CONFIG_HOME -if [ -f /usr/libexec/ibus-memconf ]; then +if [[ -f /usr/libexec/ibus-memconf ]]; then export GSETTINGS_BACKEND=keyfile fi -if [ "$1" == "--coverage" ]; then +if [[ "$1" == "--coverage" ]]; then coverage="-m coverage run --source=. --data-file=build/.coverage" fi -if [ -n "$TEAMCITY_VERSION" ]; then +if [[ -n "${TEAMCITY_VERSION}" ]]; then if ! pip3 list --format=columns | grep -q teamcity-messages; then pip3 install teamcity-messages fi @@ -23,6 +23,6 @@ else fi # shellcheck disable=SC2086 -python3 ${coverage:-} -m ${test_module:-} discover ${extra_opts:-} -s tests -p test_*.py +python3 ${coverage:-} -m "${test_module:-}" discover ${extra_opts:-} -s tests/ -p "*_tests.py" -rm -rf "$XDG_CONFIG_HOME" +rm -rf "${XDG_CONFIG_HOME}" diff --git a/linux/keyman-config/tests/test_bcp47tag.py b/linux/keyman-config/tests/bcp47tag_tests.py similarity index 100% rename from linux/keyman-config/tests/test_bcp47tag.py rename to linux/keyman-config/tests/bcp47tag_tests.py diff --git a/linux/keyman-config/tests/test_canonical_language_code_utils.py b/linux/keyman-config/tests/canonical_language_code_utils_tests.py similarity index 100% rename from linux/keyman-config/tests/test_canonical_language_code_utils.py rename to linux/keyman-config/tests/canonical_language_code_utils_tests.py diff --git a/linux/keyman-config/tests/test_custom_keyboards.py b/linux/keyman-config/tests/custom_keyboards_tests.py similarity index 100% rename from linux/keyman-config/tests/test_custom_keyboards.py rename to linux/keyman-config/tests/custom_keyboards_tests.py diff --git a/linux/keyman-config/tests/test_dconf_util.py b/linux/keyman-config/tests/dconf_util_tests.py similarity index 100% rename from linux/keyman-config/tests/test_dconf_util.py rename to linux/keyman-config/tests/dconf_util_tests.py diff --git a/linux/keyman-config/tests/test_get_kmp.py b/linux/keyman-config/tests/get_kmp_tests.py similarity index 100% rename from linux/keyman-config/tests/test_get_kmp.py rename to linux/keyman-config/tests/get_kmp_tests.py diff --git a/linux/keyman-config/tests/test_gnome_keyboards_util.py b/linux/keyman-config/tests/gnome_keyboards_util_tests.py similarity index 100% rename from linux/keyman-config/tests/test_gnome_keyboards_util.py rename to linux/keyman-config/tests/gnome_keyboards_util_tests.py diff --git a/linux/keyman-config/tests/test_gsettings.py b/linux/keyman-config/tests/gsettings_tests.py similarity index 100% rename from linux/keyman-config/tests/test_gsettings.py rename to linux/keyman-config/tests/gsettings_tests.py diff --git a/linux/keyman-config/tests/test_handle_install.py b/linux/keyman-config/tests/handle_install_tests.py similarity index 100% rename from linux/keyman-config/tests/test_handle_install.py rename to linux/keyman-config/tests/handle_install_tests.py diff --git a/linux/keyman-config/tests/test_ibus_util.py b/linux/keyman-config/tests/ibus_util_tests.py similarity index 100% rename from linux/keyman-config/tests/test_ibus_util.py rename to linux/keyman-config/tests/ibus_util_tests.py diff --git a/linux/keyman-config/tests/test_install_kmp.py b/linux/keyman-config/tests/install_kmp_tests.py similarity index 100% rename from linux/keyman-config/tests/test_install_kmp.py rename to linux/keyman-config/tests/install_kmp_tests.py diff --git a/linux/keyman-config/tests/test_kvk2ldml.py b/linux/keyman-config/tests/kvk2ldml_tests.py similarity index 100% rename from linux/keyman-config/tests/test_kvk2ldml.py rename to linux/keyman-config/tests/kvk2ldml_tests.py diff --git a/linux/keyman-config/tests/test_lang_tags_map.py b/linux/keyman-config/tests/lang_tags_map_tests.py similarity index 100% rename from linux/keyman-config/tests/test_lang_tags_map.py rename to linux/keyman-config/tests/lang_tags_map_tests.py diff --git a/linux/keyman-config/tests/test_package_install_completion.py b/linux/keyman-config/tests/package_install_completion_tests.py similarity index 100% rename from linux/keyman-config/tests/test_package_install_completion.py rename to linux/keyman-config/tests/package_install_completion_tests.py diff --git a/linux/keyman-config/tests/test_uninstall_kmp.py b/linux/keyman-config/tests/uninstall_kmp_tests.py similarity index 100% rename from linux/keyman-config/tests/test_uninstall_kmp.py rename to linux/keyman-config/tests/uninstall_kmp_tests.py From a5c80243e742746dbc29995464959ef3982b926d Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 02:24:11 +0000 Subject: [PATCH 08/22] chore(developer): add six test cases for ListIndex --- .../test/ldml-keyboard/test-string-list.ts | 43 ++++++++++++++++++- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index 0f73bbf93f..9188f3b440 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -1,9 +1,48 @@ import 'mocha'; import { assert } from 'chai'; -//import { ListIndex, ListItem } from '../../src/ldml-keyboard/string-list.js'; -import { ListItem } from '../../src/ldml-keyboard/string-list.js'; +import { StrsItem } from '../../src/kmx/kmx-plus/kmx-plus.js'; +import { ListIndex, ListItem } from '../../src/ldml-keyboard/string-list.js'; describe('Test of String-List', () => { + describe('should test ListIndex', () => { + it('can construct a ListIndex', () => { + const strsItem = new StrsItem("abc"); + const actual = new ListIndex(strsItem); + assert.deepEqual(actual.value, strsItem); + }); + it('can check two ListIndex for equality', () => { + const strsItemOne = new StrsItem("abc"); + const strsItemTwo = new StrsItem("abc"); + const listItemOne = new ListIndex(strsItemOne); + const listItemTwo = new ListIndex(strsItemTwo); + assert.isTrue(listItemOne.isEqual(listItemTwo)); + }); + it('can check two different ListIndex are not equal', () => { + const strsItemOne = new StrsItem("abc"); + const strsItemTwo = new StrsItem("def"); + const listItemOne = new ListIndex(strsItemOne); + const listItemTwo = new ListIndex(strsItemTwo); + assert.isFalse(listItemOne.isEqual(listItemTwo)); + }); + it('can check a ListIndex and string for equality', () => { + const strsItem = new StrsItem("abc"); + const listItem = new ListIndex(strsItem); + const aString = "abc"; + assert.isTrue(listItem.isEqual(aString)); + }); + it('can check a ListIndex and string for inequality', () => { + const strsItem = new StrsItem("abc"); + const listItem = new ListIndex(strsItem); + const aString = "def"; + assert.isFalse(listItem.isEqual(aString)); + }); + it('can provide a correct string representation', () => { + const strsItem = new StrsItem("abc"); + const listItem = new ListIndex(strsItem); + const expected = "abc"; + assert.deepEqual(listItem.toString(), expected); + }); + }); describe('should test ListItem', () => { it('fromStrings returns an empty ListItem if source is null', () => { const actual = ListItem.fromStrings(null, null, null); From ef46a8eab19f19591b68e49b26374ce943faea11 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 03:28:36 +0000 Subject: [PATCH 09/22] chore(developer): add a ListItem.fromStrings() test case --- .../test/ldml-keyboard/test-string-list.ts | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index 9188f3b440..66e724e148 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -1,6 +1,6 @@ import 'mocha'; import { assert } from 'chai'; -import { StrsItem } from '../../src/kmx/kmx-plus/kmx-plus.js'; +import { StrsItem, StrsOptions, DependencySections, Strs } from '../../src/kmx/kmx-plus/kmx-plus.js'; import { ListIndex, ListItem } from '../../src/ldml-keyboard/string-list.js'; describe('Test of String-List', () => { @@ -44,10 +44,23 @@ describe('Test of String-List', () => { }); }); describe('should test ListItem', () => { - it('fromStrings returns an empty ListItem if source is null', () => { + it('fromStrings should return an empty ListItem if source is null', () => { const actual = ListItem.fromStrings(null, null, null); const expected = new ListItem(); assert.deepEqual(actual, expected); }); + it('fromStrings should return a valid ListItem from a single source string', () => { + const source = ["abc"]; + const sections = { strs: new Strs }; + sections.strs.allocString = stubSectionsStrsAllocString; + const actual = ListItem.fromStrings(source, null, sections); + const expected = new ListItem(); + expected.push(new ListIndex(new StrsItem("abc"))); + assert.deepEqual(actual, expected); + }); }); }); + +function stubSectionsStrsAllocString(s?: string, opts?: StrsOptions, sections?: DependencySections): StrsItem { + return new StrsItem(s); +} From 15c71d7b951fe62ee21a4e31e32e79d6bd6807c9 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 03:38:24 +0000 Subject: [PATCH 10/22] chore(developer): add a further ListItem.fromStrings() test case --- .../web/types/test/ldml-keyboard/test-string-list.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index 66e724e148..cfb09322e3 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -58,6 +58,16 @@ describe('Test of String-List', () => { expected.push(new ListIndex(new StrsItem("abc"))); assert.deepEqual(actual, expected); }); + it('fromStrings should return a valid ListItem from a longer source', () => { + const source = ["abc", "def", "ghi"]; + const sections = { strs: new Strs }; + sections.strs.allocString = stubSectionsStrsAllocString; + const actual = ListItem.fromStrings(source, null, sections); + const expected = new ListItem(); + for (const s of source) + expected.push(new ListIndex(new StrsItem(s))); + assert.deepEqual(actual, expected); + }); }); }); From 88b0f712d09adb86e60d85229aa3480f3b3c7d38 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 03:47:28 +0000 Subject: [PATCH 11/22] chore(developer): add three ListItem.getItemOrder() test cases --- .../test/ldml-keyboard/test-string-list.ts | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index cfb09322e3..f593bae9fe 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -68,6 +68,27 @@ describe('Test of String-List', () => { expected.push(new ListIndex(new StrsItem(s))); assert.deepEqual(actual, expected); }); + it('getItemOrder should return a valid index for the first item', () => { + const listItem = new ListItem(); + for (const s of ["abc", "def", "ghi"]) + listItem.push(new ListIndex(new StrsItem(s))); + const index = listItem.getItemOrder("abc"); + assert.equal(index, 0); + }); + it('getItemOrder should return a valid index for a later item', () => { + const listItem = new ListItem(); + for (const s of ["abc", "def", "ghi"]) + listItem.push(new ListIndex(new StrsItem(s))); + const index = listItem.getItemOrder("ghi"); + assert.equal(index, 2); + }); + it('getItemOrder should return -1 for a missing item', () => { + const listItem = new ListItem(); + for (const s of ["abc", "def", "ghi"]) + listItem.push(new ListIndex(new StrsItem(s))); + const index = listItem.getItemOrder("jkl"); + assert.equal(index, -1); + }); }); }); From 769259e6f6a78bc7763ce7d233b42ab2181988c2 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 05:04:20 +0000 Subject: [PATCH 12/22] chore(developer): add four test cases for ListItem.isEqual, plus refactor for length --- .../test/ldml-keyboard/test-string-list.ts | 66 +++++++++++-------- 1 file changed, 39 insertions(+), 27 deletions(-) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index f593bae9fe..c638f0043e 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -11,28 +11,22 @@ describe('Test of String-List', () => { assert.deepEqual(actual.value, strsItem); }); it('can check two ListIndex for equality', () => { - const strsItemOne = new StrsItem("abc"); - const strsItemTwo = new StrsItem("abc"); - const listItemOne = new ListIndex(strsItemOne); - const listItemTwo = new ListIndex(strsItemTwo); + const listItemOne = new ListIndex(new StrsItem("abc")); + const listItemTwo = new ListIndex(new StrsItem("abc")); assert.isTrue(listItemOne.isEqual(listItemTwo)); }); it('can check two different ListIndex are not equal', () => { - const strsItemOne = new StrsItem("abc"); - const strsItemTwo = new StrsItem("def"); - const listItemOne = new ListIndex(strsItemOne); - const listItemTwo = new ListIndex(strsItemTwo); + const listItemOne = new ListIndex(new StrsItem("abc")); + const listItemTwo = new ListIndex(new StrsItem("def")); assert.isFalse(listItemOne.isEqual(listItemTwo)); }); it('can check a ListIndex and string for equality', () => { - const strsItem = new StrsItem("abc"); - const listItem = new ListIndex(strsItem); + const listItem = new ListIndex(new StrsItem("abc")); const aString = "abc"; assert.isTrue(listItem.isEqual(aString)); }); it('can check a ListIndex and string for inequality', () => { - const strsItem = new StrsItem("abc"); - const listItem = new ListIndex(strsItem); + const listItem = new ListIndex(new StrsItem("abc")); const aString = "def"; assert.isFalse(listItem.isEqual(aString)); }); @@ -54,8 +48,7 @@ describe('Test of String-List', () => { const sections = { strs: new Strs }; sections.strs.allocString = stubSectionsStrsAllocString; const actual = ListItem.fromStrings(source, null, sections); - const expected = new ListItem(); - expected.push(new ListIndex(new StrsItem("abc"))); + const expected = initListItem(source); assert.deepEqual(actual, expected); }); it('fromStrings should return a valid ListItem from a longer source', () => { @@ -63,35 +56,54 @@ describe('Test of String-List', () => { const sections = { strs: new Strs }; sections.strs.allocString = stubSectionsStrsAllocString; const actual = ListItem.fromStrings(source, null, sections); - const expected = new ListItem(); - for (const s of source) - expected.push(new ListIndex(new StrsItem(s))); + const expected = initListItem(source); assert.deepEqual(actual, expected); }); it('getItemOrder should return a valid index for the first item', () => { - const listItem = new ListItem(); - for (const s of ["abc", "def", "ghi"]) - listItem.push(new ListIndex(new StrsItem(s))); + const listItem = initListItem(["abc", "def", "ghi"]); const index = listItem.getItemOrder("abc"); assert.equal(index, 0); }); it('getItemOrder should return a valid index for a later item', () => { - const listItem = new ListItem(); - for (const s of ["abc", "def", "ghi"]) - listItem.push(new ListIndex(new StrsItem(s))); + const listItem = initListItem(["abc", "def", "ghi"]); const index = listItem.getItemOrder("ghi"); assert.equal(index, 2); }); it('getItemOrder should return -1 for a missing item', () => { - const listItem = new ListItem(); - for (const s of ["abc", "def", "ghi"]) - listItem.push(new ListIndex(new StrsItem(s))); - const index = listItem.getItemOrder("jkl"); + const listItem = initListItem(["abc", "def", "ghi"]); + const index = listItem.getItemOrder("jkl"); assert.equal(index, -1); }); + it('isEqual should return true for two empty ListItems', () => { + const listItemOne = new ListItem(); + const listItemTwo = new ListItem(); + assert.isTrue(listItemOne.isEqual(listItemTwo)); + }); + it('isEqual should return false for empty and non-empty ListItems', () => { + const listItemOne = new ListItem(); + const listItemTwo = initListItem(["abc"]); + assert.isFalse(listItemOne.isEqual(listItemTwo)); + }); + it('isEqual should return true for identical ListItems', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.isTrue(listItemOne.isEqual(listItemTwo)); + }); + it('isEqual should return false for different length ListItems', () => { + const listItemOne = initListItem(["abc", "def"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.isFalse(listItemOne.isEqual(listItemTwo)); + }); }); }); function stubSectionsStrsAllocString(s?: string, opts?: StrsOptions, sections?: DependencySections): StrsItem { return new StrsItem(s); } + +function initListItem(source: Array): ListItem { + const listItem = new ListItem(); + for (const s of source) + listItem.push(new ListIndex(new StrsItem(s))); + return listItem; +} From d77c5aeb6bc6c94f22d94f64536ef8846b879553 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 05:16:24 +0000 Subject: [PATCH 13/22] chore(developer): add seven additional test cases for ListItem.isEqual --- .../test/ldml-keyboard/test-string-list.ts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index c638f0043e..ce20712921 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -84,6 +84,11 @@ describe('Test of String-List', () => { const listItemTwo = initListItem(["abc"]); assert.isFalse(listItemOne.isEqual(listItemTwo)); }); + it('isEqual should return false for non-empty and empty ListItems', () => { + const listItemOne = initListItem(["abc"]); + const listItemTwo = new ListItem(); + assert.isFalse(listItemOne.isEqual(listItemTwo)); + }); it('isEqual should return true for identical ListItems', () => { const listItemOne = initListItem(["abc", "def", "ghi"]); const listItemTwo = initListItem(["abc", "def", "ghi"]); @@ -95,6 +100,26 @@ describe('Test of String-List', () => { assert.isFalse(listItemOne.isEqual(listItemTwo)); }); }); + it('isEqual should return true for empty ListItem and string[]', () => { + const listItem = new ListItem(); + assert.isTrue(listItem.isEqual([])); + }); + it('isEqual should return false for empty ListItem and non-empty string[]', () => { + const listItem = new ListItem(); + assert.isFalse(listItem.isEqual(["abc"])); + }); + it('isEqual should return false for non-empty ListItem and empty string[]', () => { + const listItem = initListItem(["abc"]);; + assert.isFalse(listItem.isEqual([])); + }); + it('isEqual should return true for identical ListItem and string[]', () => { + const listItem = initListItem(["abc", "def", "ghi"]); + assert.isTrue(listItem.isEqual(["abc", "def", "ghi"])); + }); + it('isEqual should return false for different length ListItem and string[]', () => { + const listItem = initListItem(["abc", "def"]); + assert.isFalse(listItem.isEqual(["abc", "def", "ghi"])); + }); }); function stubSectionsStrsAllocString(s?: string, opts?: StrsOptions, sections?: DependencySections): StrsItem { From 04a8a0a5d5486ba3803fcb7b266f5fcc7aa9428b Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 05:33:07 +0000 Subject: [PATCH 14/22] chore(developer): add seven test cases for ListItem.compareTo --- .../test/ldml-keyboard/test-string-list.ts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index ce20712921..3a74678a32 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -120,6 +120,41 @@ describe('Test of String-List', () => { const listItem = initListItem(["abc", "def"]); assert.isFalse(listItem.isEqual(["abc", "def", "ghi"])); }); + it('compareTo should return 0 for identical ListItems', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), 0); + }); + it('compareTo should return -1 for ListItems with different first items (smallest first)', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abd", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), -1); + }); + it('compareTo should return 1 for ListItems with different first items (smallest second)', () => { + const listItemOne = initListItem(["abd", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), 1); + }); + it('compareTo should return -1 for ListItems with different later items (smallest first)', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghj"]); + assert.equal(listItemOne.compareTo(listItemTwo), -1); + }); + it('compareTo should return 1 for ListItems with different later items (smallest second)', () => { + const listItemOne = initListItem(["abc", "def", "ghj"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), 1); + }); + it('compareTo should return -1 for identical ListItems, except shorter first', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghi", "jkl"]); + assert.equal(listItemOne.compareTo(listItemTwo), -1); + }); + it('compareTo should return 1 for identical ListItems, except longer first', () => { + const listItemOne = initListItem(["abc", "def", "ghi", "jkl"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), 1); + }); }); function stubSectionsStrsAllocString(s?: string, opts?: StrsOptions, sections?: DependencySections): StrsItem { From b3398fb9418692c3b4d092679825d0fb807e1d59 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 05:39:56 +0000 Subject: [PATCH 15/22] chore(developer): add test cases for ListItem.toString() and toStringArray() --- common/web/types/test/ldml-keyboard/test-string-list.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index 3a74678a32..ba20041329 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -155,6 +155,15 @@ describe('Test of String-List', () => { const listItemTwo = initListItem(["abc", "def", "ghi"]); assert.equal(listItemOne.compareTo(listItemTwo), 1); }); + it('toString should return correct string', () => { + const listItem = initListItem(["abc", "def", "ghi"]); + assert.deepEqual(listItem.toString(), "abc def ghi"); + }); + it('toStringArray should return correct string[]', () => { + const source = ["abc", "def", "ghi"]; + const listItem = initListItem(source); + assert.deepEqual(listItem.toStringArray(), source); + }); }); function stubSectionsStrsAllocString(s?: string, opts?: StrsOptions, sections?: DependencySections): StrsItem { From 19da0c73aee1180fff04f7331b18fa8a5ec3173b Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 05:48:51 +0000 Subject: [PATCH 16/22] chore(developer): add four additional test cases --- .../test/ldml-keyboard/test-string-list.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index ba20041329..db5853d99d 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -94,6 +94,11 @@ describe('Test of String-List', () => { const listItemTwo = initListItem(["abc", "def", "ghi"]); assert.isTrue(listItemOne.isEqual(listItemTwo)); }); + it('isEqual should return false for different ListItems', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abd", "def", "ghi"]); + assert.isFalse(listItemOne.isEqual(listItemTwo)); + }); it('isEqual should return false for different length ListItems', () => { const listItemOne = initListItem(["abc", "def"]); const listItemTwo = initListItem(["abc", "def", "ghi"]); @@ -116,6 +121,10 @@ describe('Test of String-List', () => { const listItem = initListItem(["abc", "def", "ghi"]); assert.isTrue(listItem.isEqual(["abc", "def", "ghi"])); }); + it('isEqual should return false for different ListItem and string[]', () => { + const listItem = initListItem(["abc", "def", "ghi"]); + assert.isFalse(listItem.isEqual(["abd", "def", "ghi"])); + }); it('isEqual should return false for different length ListItem and string[]', () => { const listItem = initListItem(["abc", "def"]); assert.isFalse(listItem.isEqual(["abc", "def", "ghi"])); @@ -159,11 +168,19 @@ describe('Test of String-List', () => { const listItem = initListItem(["abc", "def", "ghi"]); assert.deepEqual(listItem.toString(), "abc def ghi"); }); + it('toString should return correct string for empty ListItem', () => { + const listItem = new ListItem; + assert.deepEqual(listItem.toString(), ""); + }); it('toStringArray should return correct string[]', () => { const source = ["abc", "def", "ghi"]; const listItem = initListItem(source); assert.deepEqual(listItem.toStringArray(), source); }); + it('toStringArray should return correct string[] for empty ListItem', () => { + const listItem = new ListItem; + assert.deepEqual(listItem.toStringArray(), []); + }); }); function stubSectionsStrsAllocString(s?: string, opts?: StrsOptions, sections?: DependencySections): StrsItem { From 402b4065e0e39f69f0529bbdbda0b690a09fedf5 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Wed, 27 Nov 2024 06:10:45 +0000 Subject: [PATCH 17/22] chore(common/web): refactor tests for readability --- .../test/ldml-keyboard/test-string-list.ts | 290 +++++++++--------- 1 file changed, 151 insertions(+), 139 deletions(-) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index db5853d99d..3275c9a516 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -4,7 +4,7 @@ import { StrsItem, StrsOptions, DependencySections, Strs } from '../../src/kmx/k import { ListIndex, ListItem } from '../../src/ldml-keyboard/string-list.js'; describe('Test of String-List', () => { - describe('should test ListIndex', () => { + describe('Test ListIndex', () => { it('can construct a ListIndex', () => { const strsItem = new StrsItem("abc"); const actual = new ListIndex(strsItem); @@ -37,149 +37,161 @@ describe('Test of String-List', () => { assert.deepEqual(listItem.toString(), expected); }); }); - describe('should test ListItem', () => { - it('fromStrings should return an empty ListItem if source is null', () => { - const actual = ListItem.fromStrings(null, null, null); - const expected = new ListItem(); - assert.deepEqual(actual, expected); + describe('Test ListItem', () => { + describe('Test fromStrings()', () => { + it('should return an empty ListItem if source is null', () => { + const actual = ListItem.fromStrings(null, null, null); + const expected = new ListItem(); + assert.deepEqual(actual, expected); + }); + it('should return a valid ListItem from a single source string', () => { + const source = ["abc"]; + const sections = { strs: new Strs }; + sections.strs.allocString = stubSectionsStrsAllocString; + const actual = ListItem.fromStrings(source, null, sections); + const expected = initListItem(source); + assert.deepEqual(actual, expected); + }); + it('should return a valid ListItem from a longer source', () => { + const source = ["abc", "def", "ghi"]; + const sections = { strs: new Strs }; + sections.strs.allocString = stubSectionsStrsAllocString; + const actual = ListItem.fromStrings(source, null, sections); + const expected = initListItem(source); + assert.deepEqual(actual, expected); + }); }); - it('fromStrings should return a valid ListItem from a single source string', () => { - const source = ["abc"]; - const sections = { strs: new Strs }; - sections.strs.allocString = stubSectionsStrsAllocString; - const actual = ListItem.fromStrings(source, null, sections); - const expected = initListItem(source); - assert.deepEqual(actual, expected); + describe('Test getItemOrder()', () => { + it('should return a valid index for the first item', () => { + const listItem = initListItem(["abc", "def", "ghi"]); + const index = listItem.getItemOrder("abc"); + assert.equal(index, 0); + }); + it('should return a valid index for a later item', () => { + const listItem = initListItem(["abc", "def", "ghi"]); + const index = listItem.getItemOrder("ghi"); + assert.equal(index, 2); + }); + it('should return -1 for a missing item', () => { + const listItem = initListItem(["abc", "def", "ghi"]); + const index = listItem.getItemOrder("jkl"); + assert.equal(index, -1); + }); }); - it('fromStrings should return a valid ListItem from a longer source', () => { - const source = ["abc", "def", "ghi"]; - const sections = { strs: new Strs }; - sections.strs.allocString = stubSectionsStrsAllocString; - const actual = ListItem.fromStrings(source, null, sections); - const expected = initListItem(source); - assert.deepEqual(actual, expected); + describe('Test isEqual()', () => { + it('should return true for two empty ListItems', () => { + const listItemOne = new ListItem(); + const listItemTwo = new ListItem(); + assert.isTrue(listItemOne.isEqual(listItemTwo)); + }); + it('should return false for empty and non-empty ListItems', () => { + const listItemOne = new ListItem(); + const listItemTwo = initListItem(["abc"]); + assert.isFalse(listItemOne.isEqual(listItemTwo)); + }); + it('should return false for non-empty and empty ListItems', () => { + const listItemOne = initListItem(["abc"]); + const listItemTwo = new ListItem(); + assert.isFalse(listItemOne.isEqual(listItemTwo)); + }); + it('should return true for identical ListItems', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.isTrue(listItemOne.isEqual(listItemTwo)); + }); + it('should return false for different ListItems', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abd", "def", "ghi"]); + assert.isFalse(listItemOne.isEqual(listItemTwo)); + }); + it('should return false for different length ListItems', () => { + const listItemOne = initListItem(["abc", "def"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.isFalse(listItemOne.isEqual(listItemTwo)); + }); + it('should return true for empty ListItem and string[]', () => { + const listItem = new ListItem(); + assert.isTrue(listItem.isEqual([])); + }); + it('should return false for empty ListItem and non-empty string[]', () => { + const listItem = new ListItem(); + assert.isFalse(listItem.isEqual(["abc"])); + }); + it('should return false for non-empty ListItem and empty string[]', () => { + const listItem = initListItem(["abc"]);; + assert.isFalse(listItem.isEqual([])); + }); + it('should return true for identical ListItem and string[]', () => { + const listItem = initListItem(["abc", "def", "ghi"]); + assert.isTrue(listItem.isEqual(["abc", "def", "ghi"])); + }); + it('should return false for different ListItem and string[]', () => { + const listItem = initListItem(["abc", "def", "ghi"]); + assert.isFalse(listItem.isEqual(["abd", "def", "ghi"])); + }); + it('should return false for different length ListItem and string[]', () => { + const listItem = initListItem(["abc", "def"]); + assert.isFalse(listItem.isEqual(["abc", "def", "ghi"])); + }); }); - it('getItemOrder should return a valid index for the first item', () => { - const listItem = initListItem(["abc", "def", "ghi"]); - const index = listItem.getItemOrder("abc"); - assert.equal(index, 0); + describe('Test compareTo()', () => { + it('should return 0 for identical ListItems', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), 0); + }); + it('should return -1 for ListItems with different first items (smallest first)', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abd", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), -1); + }); + it('should return 1 for ListItems with different first items (smallest second)', () => { + const listItemOne = initListItem(["abd", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), 1); + }); + it('should return -1 for ListItems with different later items (smallest first)', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghj"]); + assert.equal(listItemOne.compareTo(listItemTwo), -1); + }); + it('should return 1 for ListItems with different later items (smallest second)', () => { + const listItemOne = initListItem(["abc", "def", "ghj"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), 1); + }); + it('should return -1 for identical ListItems, except shorter first', () => { + const listItemOne = initListItem(["abc", "def", "ghi"]); + const listItemTwo = initListItem(["abc", "def", "ghi", "jkl"]); + assert.equal(listItemOne.compareTo(listItemTwo), -1); + }); + it('should return 1 for identical ListItems, except longer first', () => { + const listItemOne = initListItem(["abc", "def", "ghi", "jkl"]); + const listItemTwo = initListItem(["abc", "def", "ghi"]); + assert.equal(listItemOne.compareTo(listItemTwo), 1); + }); }); - it('getItemOrder should return a valid index for a later item', () => { - const listItem = initListItem(["abc", "def", "ghi"]); - const index = listItem.getItemOrder("ghi"); - assert.equal(index, 2); + describe('Test toString()', () => { + it('should return correct string', () => { + const listItem = initListItem(["abc", "def", "ghi"]); + assert.deepEqual(listItem.toString(), "abc def ghi"); + }); + it('should return correct string for empty ListItem', () => { + const listItem = new ListItem; + assert.deepEqual(listItem.toString(), ""); + }); }); - it('getItemOrder should return -1 for a missing item', () => { - const listItem = initListItem(["abc", "def", "ghi"]); - const index = listItem.getItemOrder("jkl"); - assert.equal(index, -1); - }); - it('isEqual should return true for two empty ListItems', () => { - const listItemOne = new ListItem(); - const listItemTwo = new ListItem(); - assert.isTrue(listItemOne.isEqual(listItemTwo)); - }); - it('isEqual should return false for empty and non-empty ListItems', () => { - const listItemOne = new ListItem(); - const listItemTwo = initListItem(["abc"]); - assert.isFalse(listItemOne.isEqual(listItemTwo)); - }); - it('isEqual should return false for non-empty and empty ListItems', () => { - const listItemOne = initListItem(["abc"]); - const listItemTwo = new ListItem(); - assert.isFalse(listItemOne.isEqual(listItemTwo)); - }); - it('isEqual should return true for identical ListItems', () => { - const listItemOne = initListItem(["abc", "def", "ghi"]); - const listItemTwo = initListItem(["abc", "def", "ghi"]); - assert.isTrue(listItemOne.isEqual(listItemTwo)); - }); - it('isEqual should return false for different ListItems', () => { - const listItemOne = initListItem(["abc", "def", "ghi"]); - const listItemTwo = initListItem(["abd", "def", "ghi"]); - assert.isFalse(listItemOne.isEqual(listItemTwo)); - }); - it('isEqual should return false for different length ListItems', () => { - const listItemOne = initListItem(["abc", "def"]); - const listItemTwo = initListItem(["abc", "def", "ghi"]); - assert.isFalse(listItemOne.isEqual(listItemTwo)); - }); - }); - it('isEqual should return true for empty ListItem and string[]', () => { - const listItem = new ListItem(); - assert.isTrue(listItem.isEqual([])); - }); - it('isEqual should return false for empty ListItem and non-empty string[]', () => { - const listItem = new ListItem(); - assert.isFalse(listItem.isEqual(["abc"])); - }); - it('isEqual should return false for non-empty ListItem and empty string[]', () => { - const listItem = initListItem(["abc"]);; - assert.isFalse(listItem.isEqual([])); - }); - it('isEqual should return true for identical ListItem and string[]', () => { - const listItem = initListItem(["abc", "def", "ghi"]); - assert.isTrue(listItem.isEqual(["abc", "def", "ghi"])); - }); - it('isEqual should return false for different ListItem and string[]', () => { - const listItem = initListItem(["abc", "def", "ghi"]); - assert.isFalse(listItem.isEqual(["abd", "def", "ghi"])); - }); - it('isEqual should return false for different length ListItem and string[]', () => { - const listItem = initListItem(["abc", "def"]); - assert.isFalse(listItem.isEqual(["abc", "def", "ghi"])); - }); - it('compareTo should return 0 for identical ListItems', () => { - const listItemOne = initListItem(["abc", "def", "ghi"]); - const listItemTwo = initListItem(["abc", "def", "ghi"]); - assert.equal(listItemOne.compareTo(listItemTwo), 0); - }); - it('compareTo should return -1 for ListItems with different first items (smallest first)', () => { - const listItemOne = initListItem(["abc", "def", "ghi"]); - const listItemTwo = initListItem(["abd", "def", "ghi"]); - assert.equal(listItemOne.compareTo(listItemTwo), -1); - }); - it('compareTo should return 1 for ListItems with different first items (smallest second)', () => { - const listItemOne = initListItem(["abd", "def", "ghi"]); - const listItemTwo = initListItem(["abc", "def", "ghi"]); - assert.equal(listItemOne.compareTo(listItemTwo), 1); - }); - it('compareTo should return -1 for ListItems with different later items (smallest first)', () => { - const listItemOne = initListItem(["abc", "def", "ghi"]); - const listItemTwo = initListItem(["abc", "def", "ghj"]); - assert.equal(listItemOne.compareTo(listItemTwo), -1); - }); - it('compareTo should return 1 for ListItems with different later items (smallest second)', () => { - const listItemOne = initListItem(["abc", "def", "ghj"]); - const listItemTwo = initListItem(["abc", "def", "ghi"]); - assert.equal(listItemOne.compareTo(listItemTwo), 1); - }); - it('compareTo should return -1 for identical ListItems, except shorter first', () => { - const listItemOne = initListItem(["abc", "def", "ghi"]); - const listItemTwo = initListItem(["abc", "def", "ghi", "jkl"]); - assert.equal(listItemOne.compareTo(listItemTwo), -1); - }); - it('compareTo should return 1 for identical ListItems, except longer first', () => { - const listItemOne = initListItem(["abc", "def", "ghi", "jkl"]); - const listItemTwo = initListItem(["abc", "def", "ghi"]); - assert.equal(listItemOne.compareTo(listItemTwo), 1); - }); - it('toString should return correct string', () => { - const listItem = initListItem(["abc", "def", "ghi"]); - assert.deepEqual(listItem.toString(), "abc def ghi"); - }); - it('toString should return correct string for empty ListItem', () => { - const listItem = new ListItem; - assert.deepEqual(listItem.toString(), ""); - }); - it('toStringArray should return correct string[]', () => { - const source = ["abc", "def", "ghi"]; - const listItem = initListItem(source); - assert.deepEqual(listItem.toStringArray(), source); - }); - it('toStringArray should return correct string[] for empty ListItem', () => { - const listItem = new ListItem; - assert.deepEqual(listItem.toStringArray(), []); + describe('Test toStringArray()', () => { + it('should return correct string[]', () => { + const source = ["abc", "def", "ghi"]; + const listItem = initListItem(source); + assert.deepEqual(listItem.toStringArray(), source); + }); + it('should return correct string[] for empty ListItem', () => { + const listItem = new ListItem; + assert.deepEqual(listItem.toStringArray(), []); + }); + }); }); }); From 5dee258dac09f861764986a2c13e543bb5546c63 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Wed, 27 Nov 2024 15:37:06 +0700 Subject: [PATCH 18/22] docs(android): Add android/docs/internal/README --- android/README.md | 13 ++++++++++--- android/docs/internal/README.md | 5 +++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 android/docs/internal/README.md diff --git a/android/README.md b/android/README.md index 8b32b99f54..6abb94161d 100644 --- a/android/README.md +++ b/android/README.md @@ -34,7 +34,7 @@ analytics for Debug are associated with an App Bundle ID ### Compiling From Command Line 1. Launch a command prompt and cd to the directory **keyman/android** -2. Run the top level build script `./build.sh configure build --debug` which will: +2. Run the top level build script `./build.sh configure build:engine build:app --debug` which will: * Compile KMEA (and its KMW dependency) * Download default keyboard and dictionary resources as needed * Compile KMAPro @@ -79,7 +79,7 @@ analytics for Debug are associated with an App Bundle ID Replace `SERIAL` with the device serial number listed in step 2. ### Compiling the app's offline help -Keyman for Android help is maintained in the Markdown files in android/docs/. +Keyman for Android help is maintained in the Markdown files in android/docs/help. The script `/resources/build/build-help.inc.sh` uses the `pandoc` tool to convert the Markdown files into html. ```bash @@ -121,7 +121,7 @@ Building these projects follow the same steps as KMAPro: ## How to Build Keyman Engine for Android 1. Open a terminal or Git Bash prompt and go to the Android project folder (e.g. `cd ~/keyman/android/`) -2. Run `./build.sh --debug` +2. Run `./build.sh build:engine --debug` Keyman Engine for Android library (**keyman-engine.aar**) is now ready to be imported in any project. @@ -167,3 +167,10 @@ dependencies { ```` 5. include `import com.keyman.engine.*;` to use Keyman Engine in a class. + +### Keyman Engine for Android help content +Keyman Engine for Android help is maintained in the Markdown files in android/docs/engine/. + +## Design Documentation + +Internal design documents about features pertaining to Keyman for Android and Keyman Engine for Android are maintained in the Markdown files in android/docs/internal/. diff --git a/android/docs/internal/README.md b/android/docs/internal/README.md new file mode 100644 index 0000000000..ef51df7f60 --- /dev/null +++ b/android/docs/internal/README.md @@ -0,0 +1,5 @@ +# Keyman for Android and Keyman Engine for Android + +## Internal Documents + +This folder is for storing design documents of new features pertaining to Keyman for Android and Keyman Engine for Android From 7edda3becaa1153c60ee8a93870a3711322d40fa Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 27 Nov 2024 10:16:58 +0100 Subject: [PATCH 19/22] chore(linux): address code review comments --- docs/linux/README.md | 4 ++++ docs/linux/keyman-config.md | 2 +- docs/settings/linux/launch.json | 2 +- docs/settings/linux/settings.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/linux/README.md b/docs/linux/README.md index fe29b0d623..80c1a78434 100644 --- a/docs/linux/README.md +++ b/docs/linux/README.md @@ -64,6 +64,10 @@ To just run the unit tests without integration tests, add the It's also possible to only run the tests for one of the subprojects. You can use `build.sh` in the subdirectory for that. +Unit tests should be named after the file/class they are testing and +follow the pattern `*.tests.` (e.g. `keymanutil.tests.c`) or +for Python `*_tests.py`. + ### ibus-keyman If you want to run the ibus-keyman tests with Wayland, you'll have to diff --git a/docs/linux/keyman-config.md b/docs/linux/keyman-config.md index 93ed3ffd8b..1a039d0f5e 100644 --- a/docs/linux/keyman-config.md +++ b/docs/linux/keyman-config.md @@ -200,7 +200,7 @@ LANGUAGE=de ./km-config "python.testing.unittestArgs": [ "-v", "-s", "linux/keyman-config/tests", - "-p", "test_*.py" + "-p", "*_tests.py" ], "python.testing.unittestEnabled": true, ``` diff --git a/docs/settings/linux/launch.json b/docs/settings/linux/launch.json index e29c16fa45..fec5afe0ad 100644 --- a/docs/settings/linux/launch.json +++ b/docs/settings/linux/launch.json @@ -62,7 +62,7 @@ "request": "launch", "name": "Launch ibus-keyman unit tests", "target": "./keymanutil_tests", - "cwd": "${workspaceFolder}/linux/build/x86_64/debug/src/test", + "cwd": "${workspaceFolder}/linux/build/x86_64/debug/src/tests", "valuesFormatting": "parseText", "internalConsoleOptions": "openOnSessionStart", "env": { diff --git a/docs/settings/linux/settings.json b/docs/settings/linux/settings.json index 482630bdec..3fd13430d1 100644 --- a/docs/settings/linux/settings.json +++ b/docs/settings/linux/settings.json @@ -5,7 +5,7 @@ "python.testing.unittestArgs": [ "-v", "-s", "linux/keyman-config/tests", - "-p", "test_*.py" + "-p", "*_tests.py" ], "python.testing.unittestEnabled": true, "python.testing.pytestEnabled": false, From 060c80463eb875faa30d653f6c0746c95fb4b12e Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Wed, 27 Nov 2024 13:01:55 -0500 Subject: [PATCH 20/22] auto: increment master version to 18.0.147 --- HISTORY.md | 9 +++++++++ VERSION.md | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index 282950db67..b2771fd853 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,14 @@ # Keyman Version History +## 18.0.146 alpha 2024-11-27 + +* test(developer): kmcmplib compiler unit tests 5 (#12612) +* refactor(common): move all lexical model types into `LexicalModelTypes` container (#12712) +* refactor(common): move remaining LDML keyboard types into `LdmlKeyboardTypes` (#12713) +* chore(web): rename test files and folders (#12704) +* chore(core): rename test files (#12705) +* chore(linux): rename test files (#12706) + ## 18.0.145 alpha 2024-11-26 * docs(windows): update emscripten bash setup (#12700) diff --git a/VERSION.md b/VERSION.md index aa8a5efd51..1c488bbaed 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -18.0.146 \ No newline at end of file +18.0.147 \ No newline at end of file From 4dbb33eac43d387b728d6bbc596940a817749a45 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Thu, 28 Nov 2024 01:43:37 +0000 Subject: [PATCH 21/22] chore(common/web): add copyright banner --- common/web/types/test/ldml-keyboard/test-string-list.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index 3275c9a516..f125f80abe 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -1,3 +1,11 @@ +/* + * Keyman is copyright (C) SIL Global. MIT License. + * + * Created by Dr Mark C. Sinclair on 2024-11-28 + * + * Test code for string-lists.ts + */ + import 'mocha'; import { assert } from 'chai'; import { StrsItem, StrsOptions, DependencySections, Strs } from '../../src/kmx/kmx-plus/kmx-plus.js'; From 1837529765bb1f76048a2b4fa0fbe8db6e7b4510 Mon Sep 17 00:00:00 2001 From: "Dr Mark C. Sinclair" Date: Thu, 28 Nov 2024 01:48:16 +0000 Subject: [PATCH 22/22] chore(common/web): add braces to for loop in initListItem() --- common/web/types/test/ldml-keyboard/test-string-list.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/test-string-list.ts index f125f80abe..58365bda66 100644 --- a/common/web/types/test/ldml-keyboard/test-string-list.ts +++ b/common/web/types/test/ldml-keyboard/test-string-list.ts @@ -209,7 +209,8 @@ function stubSectionsStrsAllocString(s?: string, opts?: StrsOptions, sections?: function initListItem(source: Array): ListItem { const listItem = new ListItem(); - for (const s of source) + for (const s of source) { listItem.push(new ListIndex(new StrsItem(s))); + } return listItem; }