Commit graph

5202 commits

Author SHA1 Message Date
Dr Mark C. Sinclair
474adf80ac chore(common/web): Merge branch 'master' into fix/common/web/types/12761-delete-replaceExtension 2024-12-05 10:35:43 +00:00
Dr Mark C. Sinclair
608624996b chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-file-types 2024-12-05 10:27:43 +00:00
Steven R. Loomis
c38077459a Merge remote-tracking branch 'upstream/master' into feat/developer/7394-verify-normalization-epic-ldml 2024-12-04 13:51:14 -06:00
Eberhard Beilharz
ed22cc00a6
fix(common): rename test file
This change renames a new test file and moves it to the new location.
This file was overlooked in #12709.
2024-12-04 10:44:05 +01:00
Eberhard Beilharz
9a6e33652a
Merge pull request #12709 from keymanapp/chore/common/rename-tests
chore(common): rename test files
2024-12-04 09:03:07 +01:00
Eberhard Beilharz
cbbb643ed0
chore(common): rename common/web/types/test to .../tests
Addresses code review comment.
2024-12-03 13:53:13 +01:00
Dr Mark C. Sinclair
11556a8009 fix(common/web): delete replaceExtension() tests 2024-12-03 11:24:58 +00:00
Dr Mark C. Sinclair
e197a889ce fix(common/web): delete replaceExtension 2024-12-03 11:17:33 +00:00
Dr Mark C. Sinclair
15a171f871 chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-file-types 2024-12-03 10:52:21 +00:00
Steven R. Loomis
17185d79a9
Merge branch 'master' into feat/developer/7394-verify-normalization-epic-ldml 2024-12-02 11:36:21 -06:00
Steven R. Loomis
6f2a6b2ebf feat(common,developer): tests and warning on denormalized content per review comments
- report a warning on each separate instance of a denormalized string (once per string).

Fixes: #7394
2024-12-02 11:35:06 -06:00
Marc Durdin
9a01ac166d chore(core): Merge branch 'master' into fix/core/12619-disable-assertions-vcwin-release-build 2024-12-01 16:17:21 +07:00
Steven R. Loomis
f4b7e0aea3
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2024-11-29 22:13:25 -06:00
Steven R. Loomis
add502e1a9 feat(common,developer): tests and warning on denormalized content
- common: shift the 'strs' processing slightly, because otherwise we normalize to NFD before even tracking the strings
- if any string is neither NFC nor NFD, give a warning
- add tests for the same

Fixes: #7394
2024-11-29 12:16:11 -06:00
Steven R. Loomis
8e19508a81 feat(common): isDenormalized() function for checking strings that are neither NFC nor NFD
Fixes: #7394
2024-11-29 11:06:53 -06:00
Dr Mark C. Sinclair
b923e13930 chore(common/web): add blank line at end of file 2024-11-29 03:42:40 +00:00
Dr Mark C. Sinclair
ed3e93f3d5 chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-file-types 2024-11-29 03:34:24 +00:00
Dr Mark C. Sinclair
eccc7edeba chore(common/web): add blank line at end of file 2024-11-29 03:30:08 +00:00
Dr Mark C. Sinclair
1d0dddb11e chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-unicodeset-parser-api 2024-11-29 03:27:39 +00:00
Dr Mark C. Sinclair
3de4f997e1 chore(common/web): remove MockUnicodeSet as unnecessary 2024-11-29 01:56:38 +00:00
Eberhard Beilharz
c27ac9e4be
chore(common): rename test files
This change rename the test files in Common according to the discussion
at the Keyman conference in November 2024.
2024-11-28 15:28:22 +01:00
Eberhard Beilharz
c7773f9e9c
Merge pull request #12719 from keymanapp/refactor/common/tc_tests
refactor(common): output number of tests when running on TC
2024-11-28 19:41:16 +07:00
Dr Mark C. Sinclair
9fd2d4a674 chore(common/web): add five test cases for fromFilename() 2024-11-28 06:07:21 +00:00
Dr Mark C. Sinclair
920b702eef chore(common/web): add five test cases for replaceExtension(), two commented out as failing 2024-11-28 05:56:22 +00:00
Dr Mark C. Sinclair
589698b799 chore(common/web): add three test cases for filenameIs() 2024-11-28 05:16:48 +00:00
Dr Mark C. Sinclair
5a56d0f159 chore(common/web): add four test cases for binaryTypeFromFilename() 2024-11-28 03:21:16 +00:00
Dr Mark C. Sinclair
d08b6933f4 chore(common/web): add four test cases for sourceTypeFromFilename() 2024-11-28 03:16:17 +00:00
Dr Mark C. Sinclair
1782f8db09 chore(common/web): add four test cases for sourceOrBinaryTypeFromFilename() 2024-11-28 03:03:48 +00:00
Marc Durdin
e640caaa9c chore(core): Merge branch 'master' into fix/core/12619-disable-assertions-vcwin-release-build 2024-11-28 09:53:45 +07:00
Marc Durdin
d71cb56ca7 fix(core): rename assert() to test_assert() in unit tests
Had a real yak shave this morning with disabling assertions in release
builds in our C/C++ code. It turns out that our unit tests use
`assert()` which we intended to use from `test_assert.h`, but in some
cases `cassert` or `assert.h` had been #included after `test_assert.h`,
overriding our special `assert()` macro. The chain of includes is
somewhat hard to puzzle out -- it's often buried several levels deep.
This meant that a release build would drop all test assertions, meaning
most tests passed, unsurprisingly, as there were no assertions left to
fail ... but some tests failed with crashes because we optimized out
important lines such as `assert(some_important_function())`.

I was quite unhappy with this fragility, so I have opted to rename
`assert()` to `test_assert()` in all of our home-grown C/C++ unit tests,
which further highlighted unit tests which were only using the C/C++
`assert()` and not ours, so then had to figure out which unit test
executables needed to have `test_assert` added, and then ... then ...
discovered a bug in `test_color.h`, where we were #including
`io.h`/`unistd.h` inside a `namespace console_color {}` block, which
just happened to be the first ref to those beautiful headers, and thus
(because `#pragma once`) meant that useful little functions like
`access()` were no longer accessible to us in the global namespace.

I have also audited Every Single Call to `assert()` to verify that we do
not do Important Work inside the parentheses, and, apart from those
offending unit tests, now resolved with `test_assert()`, it looks like
all is good.

I would like to present one very well-shaved yak in this commit.

Fixes: #12619
2024-11-28 09:46:01 +07:00
Dr Mark C. Sinclair
324c57f793 chore(common/web): test Source file extension removal 2024-11-28 02:19:19 +00:00
Dr Mark C. Sinclair
3682766ff7 chore(common/web): add copyright banner 2024-11-28 02:15:46 +00:00
Dr Mark C. Sinclair
ba44fe6fcb chore(common/web): Merge branch 'test/common/web/types/9052-unit-tests-unicodeset-parser-api' into test/common/web/types/9052-unit-tests-file-types 2024-11-28 02:11:40 +00:00
Dr Mark C. Sinclair
66d0587370 chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-file-types 2024-11-28 02:10:56 +00:00
Dr Mark C. Sinclair
a2cb00aa81 chore(common/web): add copyright banner 2024-11-28 02:01:45 +00:00
Dr Mark C. Sinclair
6bc46b030f chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-unicodeset-parser-api 2024-11-28 01:54:50 +00:00
Dr Mark C. Sinclair
1837529765 chore(common/web): add braces to for loop in initListItem() 2024-11-28 01:48:16 +00:00
Dr Mark C. Sinclair
4dbb33eac4 chore(common/web): add copyright banner 2024-11-28 01:43:37 +00:00
Eberhard Beilharz
d151d0999f
refactor(common): output number of tests when running on TC
This change adds the mocha-teamcity-reporter which outputs the running
tests in a special format that TeamCity can interpret. This allows TC
to show which tests run as well as the number of tests run.
2024-11-27 11:15:43 +01:00
Marc Durdin
18d00c7701 fix(core): use NDEBUG flag to disable assertions in release build for VC++
This disables assertions in release builds in Windows only. Other
platforms may have different outcomes.

Fixes: #12619
2024-11-27 15:34:34 +07:00
Dr Mark C. Sinclair
bf7f4c2bc2 chore(common/web): add initial removeExtension test cases 2024-11-27 08:34:06 +00:00
Dr Mark C. Sinclair
acf156b965 chore(common/web): add test-unicodeset-parser.ts to test UnicodeSet 2024-11-27 07:02:44 +00:00
Dr Mark C. Sinclair
60967375a3 chore(common/web): Merge branch 'master' into test/common/web/types/9052-unit-tests-string-list 2024-11-27 06:25:53 +00:00
Dr Mark C. Sinclair
402b4065e0 chore(common/web): refactor tests for readability 2024-11-27 06:10:45 +00:00
Dr Mark C. Sinclair
19da0c73ae chore(developer): add four additional test cases 2024-11-27 05:48:51 +00:00
Dr Mark C. Sinclair
b3398fb941 chore(developer): add test cases for ListItem.toString() and toStringArray() 2024-11-27 05:39:56 +00:00
Dr Mark C. Sinclair
04a8a0a5d5 chore(developer): add seven test cases for ListItem.compareTo 2024-11-27 05:33:07 +00:00
Dr Mark C. Sinclair
d77c5aeb6b chore(developer): add seven additional test cases for ListItem.isEqual 2024-11-27 05:16:24 +00:00
Dr Mark C. Sinclair
769259e6f6 chore(developer): add four test cases for ListItem.isEqual, plus refactor for length 2024-11-27 05:04:20 +00:00
Marc Durdin
b54b005830 refactor(common): move remaining LDML keyboard types into LdmlKeyboardTypes
Follows: #12712
2024-11-27 11:52:53 +07:00