test(core): add LDML baseline test with minimal keyboard
This replaces and enables the commented `k_000_null_keyboard` test which didn't work because keys that are not on any layer don't produce output. This instead defines a minimal keyboard with just two keys and then tests typing a key that is on the keyboard followed by a key not on the keyboard.
refactor(core): simplify loop for removing text
Instead of using an iterator to loop over the context items, incrementing a counter on each iteration, and then finally removing the calculated number of context items from the list, this change loops through the list and looks at the last context item, removing it if necessary.
Follows: #15596
fix(core): fix iterator in backspace handling
This change replaces the reverse iterator loop that holds a stale iterator across `pop_back()` calls with a pattern that directly accesses `context.back()` on each iteration. This avoids undefined behavior from iterator invalidation when mutating the list or vector.
While so far the previous code didn't show problems, it might still access released memory depending on the implementation. The documentation for `pop_back()` says "References and iterators to the erased element are invalidated", so the previous implementation was clearly wrong.
This replaces and enables the commented `k_000_null_keyboard` test which
didn't work because keys that are not on any layer don't produce output.
This instead defines a minimal keyboard with just two keys and then tests
typing a key that is on the keyboard followed by a key not on the keyboard.
Test-bot: skip
Instead of using an iterator to loop over the context items, incrementing
a counter on each iteration, and then finally removing the calculated
number of context items from the list, this change loops through the list
and looks at the last context item, removing it if necessary.
Follows: #15596
Test-bot: skip
Production code uses a list of context items, so this change modifies
the tests to also use a list instead of a vector to more closely match
production code.
Addresses code review comment.
Test-bot: skip
This change replaces the reverse iterator loop that holds a stale iterator
across `pop_back()` calls with a pattern that directly accesses
`context.back()` on each iteration. This avoids undefined behavior from
iterator invalidation when mutating the list or vector.
While so far the previous code didn't show problems, it might still access
released memory depending on the implementation. The documentation for
`pop_back()` says "References and iterators to the erased element are
invalidated", so the previous implementation was clearly wrong.
Test-bot: skip
The command shortcuts that were used by Web
scripts to create bundles via `esbuild` were not
properly handling the $KEYMAN_ROOT path when it
contained a space. These changes will rectify
this behavior and permit builds for such cases.
Build-bot: skip build:web
Test-bot: skip
fix(linux): check for existing file before trying to install
Under some circumstances it's possible that the user manages to select a directory instead of a kmp file, or manually enters a non-existing file. Is used to throw an error that we caught on Sentry; the user was able to continue to use the app. This change now checks for a valid file before trying to install the kmp file.
Fixes: #15572
Fixes: KEYMAN-LINUX-99
Under some circumstances it's possible that the user manages to select
a directory instead of a kmp file, or manually enters a non-existing file.
Is used to throw an error that we caught on Sentry; the user was able to
continue to use the app. This change now checks for a valid file before
trying to install the kmp file.
Fixes: #15572
Fixes: KEYMAN-LINUX-99
chore(linux): use xz compression for source tarballs 🗜️
Using the xz compression instead of gzip greatly reduces the size of the tarball.
Follows: #15566
fix(linux): include missing artifacts in source tarball 🗜️
With this change it's possible to build Keyman from the source tarball by running `./build.sh` from the Keyman root directory.
When building Keyman as part of the Ubuntu/Debian packaging, we don't use the toplevel `build.sh` file but instead call the build scripts in the subdirectories. This omits building some components that are currently not needed for running Keyman for Linux. The `dist.sh` script only includes the necessary files in this case, distinguished by the `origdist` parameter. This results in a significantly smaller tarball (2.5MB vs 51MB).
This change also enhances the `generate_tar_ignore_list` function so that it is now possible to add `build` to the exclude list to ignore all `build` subdirectories.
Fixes: #15544
This change adds the `assert-true` and `assert-false` function to our
bash testing framework, together with unit tests.
Also rename the test file to `testing-framework.inc.tests.sh` to match
the implementation file.
With this change it's possible to build Keyman from the source tarball
by running `./build.sh` from the Keyman root directory.
When building Keyman as part of the Ubuntu/Debian packaging, we don't use
the toplevel `build.sh` file but instead call the build scripts in the
subdirectories. This omits building some components that are currently
not needed for running Keyman for Linux. The `dist.sh` script only
includes the necessary files in this case, distinguished by the `origdist`
parameter. This results in a significantly smaller tarball (2.5MB vs 51MB).
This change also enhances the `generate_tar_ignore_list` function so that
it is now possible to add `build` to the exclude list to ignore all
`build` subdirectories.
Fixes: #15544
Build-bot: skip
Test-bot: skip
This change updates the copyright year in the `debian/copyright` file
as well as the `Standards-Version` to 4.7.3 in `debian/control`.
Cherry-pick-of: #15558
Test-bot: skip