Commit graph

12 commits

Author SHA1 Message Date
Tim Chevalier
d0e30acc68 ICU-23059 ICU4C MF2: Spec test updates
Some checks failed
GHA CI Valgrind / clang-valgrind-intltest (spoof) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (translit) (push) Has been cancelled
GHA ICU4C / uconfig-header-tests (-DUCONFIG_NO_IDNA=1) (push) Has been cancelled
GHA ICU4C / uconfig-header-tests (-DUCONFIG_NO_LEGACY_CONVERSION=1 -DUCONFIG_NO_NORMALIZATION=1 -DUCONFIG_NO_BREAK_ITERATION=1 -DUCONFIG_NO_IDNA=1 -DUCONFIG_NO_COLLATION=1 -DUCONFIG_NO_FORMATTING=1 -DUCONFIG_NO_MF2=1 -DUCONFIG_NO_TRANSLITERATION=1 -DUCONFIG_NO_REG… (push) Has been cancelled
GHA ICU4C / uconfig-header-tests (-DUCONFIG_NO_LEGACY_CONVERSION=1) (push) Has been cancelled
GHA ICU4C / icu4c-without-collation-rule-strings (push) Has been cancelled
GHA ICU4C / icu4c-icuexportdata (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (rbbi) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-test (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (bidi) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (collator) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (convert) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (csdet) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (format) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (rbnfrt) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (regex) (push) Has been cancelled
GHA ICU4C / uconfig-header-tests (-DUCONFIG_NO_MF2=1) (push) Has been cancelled
GHA ICU4C / uconfig-header-tests (-DUCONFIG_NO_NORMALIZATION=1) (push) Has been cancelled
GHA ICU4C / uconfig-header-tests (-DUCONFIG_NO_REGULAR_EXPRESSIONS=1) (push) Has been cancelled
GHA ICU4C / uconfig-header-tests (-DUCONFIG_NO_SERVICE=1) (push) Has been cancelled
GHA ICU4C / uconfig-header-tests (-DUCONFIG_NO_TRANSLITERATION=1) (push) Has been cancelled
GHA ICU4C / unicode-update-tools (push) Has been cancelled
GHA ICU4C / icu4c-test-samples (push) Has been cancelled
GHA ICU4C / icu4c-uconfig-no-conversion (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (icuserv) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (idna) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (normalize) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (rbnf) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (rbnfp) (push) Has been cancelled
GHA CI Valgrind / clang-valgrind-intltest (utility) (push) Has been cancelled
Update spec tests to current version from message-format-wg

  - Update parser for changed name-start grammar rule
  - Validate number literals in :number implementation (since parser no longer does this)
  - Disallow `:number`/`:integer` select option set from variable

    See https://github.com/unicode-org/message-format-wg/pull/1016

    As part of this, un-skip tests where the `bad-option` error is
    expected, and implement validating digit size options
    (pending PR https://github.com/unicode-org/icu/pull/2973 is intended
    to do this more fully)
2025-03-27 15:20:49 -07:00
Tim Chevalier
0748442ed6 ICU-23059 ICU4C MF2: Update spec tests
This updates the MF2 spec tests to 943479b602 with the following exceptions:

- functions/currency.json and functions/math.json are omitted because these are not yet implemented

- bidi.json will be handled in a future PR

- u-options.json will be handled in a future PR

Changes include:
* `:integer` now returns a value encapsulating the rounded numeric value of the argument, rather than
  the value itself.
* Fallbacks are handled according to the current spec.
* Fallback values are not passed into functions.
* Characters inside literal fallbacks are properly escaped.
* The test runner skips null values properly.
* The test runner handles boolean `expErrors` in defaultTestProperties.
* `:string` normalizes its input and normalizeNFC() has been refactored so it can be called there.
2025-02-25 12:24:07 -08:00
Tim Chevalier
7b8110f003 ICU-22907 MF2: Finish updating spec tests and implement required test functions
Implement :test:format, :test:select, and :test:function, which are
required by the new `pattern-selection.json` tests.

Change the internal value representation in the formatter in order to
support some of the test cases (binding the results of selectors to a
variable).
2025-02-08 21:42:03 -06:00
Tim Chevalier
1b8118049f ICU-22940 MF2 ICU4C: Update for bidi support
Per https://github.com/unicode-org/message-format-wg/pull/884
2024-12-11 12:32:25 -08:00
Tim Chevalier
62b95bb5f9 ICU-22908 MF2: Update spec tests and update implementation for recent spec changes
Updating the spec tests requires two implementation changes:
* Match on variables rather than expressions --
  see https://github.com/unicode-org/message-format-wg/pull/877
* Require attribute values to be literals (if present) --
  see https://github.com/unicode-org/message-format-wg/pull/894

This updates the spec tests to commit 6c3704f41a9c24427126429fb43992b03609dfc8
in https://github.com/unicode-org/message-format-wg/ . Any changes
following that commit will be addressed in a future PR.
2024-12-09 09:38:28 -08:00
Tim Chevalier
0357501948 ICU-22942 MF2 ICU4C: NFC-normalize names and keys according to spec
Includes adding !UCONFIG_NO_NORMALIZATION guards to all MF2 files
2024-11-06 12:48:35 -08:00
Mihai Nita
8ce61b1139 ICU-22919 Enable CI with JDK 21 and fix the json parsing 2024-09-25 09:25:04 -07:00
Tim Chevalier
2f348f4c7a ICU-22902 Remove support for Unsupported, Private & Reserved constructs
Matching PR #883 in the message-format-wg repo.

Also move spec tests for unsupported statements and expressions into new files
to serve as syntax error tests.
2024-09-20 17:29:07 -07:00
Tim Chevalier
8f82facca8 ICU-22898 MF2 parser bug fixes
ICU4C: Escape curly braces when serializing and normalizing
ICU4C: Escape '|' in patterns
ICU4C: When normalizing input, escape optionally-escaped characters in patterns
ICU4C/ICU4J: Allow trailing whitespace after a match
ICU4C: Fix parser to iterate over code points, not code units
Add tests with old reserved syntax as syntax-error tests
2024-09-20 16:22:34 -07:00
Mihai Nita
09c5aa1b74 ICU-22893 Remove support for Unsupported, Private & Reserved constructs
- Matching PR #883 in the message-format-wg repo.
- Also removes some unused imports
2024-09-18 16:12:54 -07:00
Tim Chevalier
747d5eef3b ICU-22834 Update tests to reflect MF2 schema in conformance repo
This also updates the spec tests from the current version of the MFWG
repository and removes some duplicate tests.
Spec tests now reflect the message-format-wg repo as of
5612f3b050

It also updates both the ICU4C and ICU4J parsers to follow the
current test schema in the conformance repository.

This includes adding code to both parsers to allow `src` to be
either a single string or an array of strings (per
https://github.com/unicode-org/conformance/pull/255 ),
and eliminating `srcs` in tests.

It also includes other changes to make updated spec tests pass:

ICU4C: Allow trailing whitespace for complex messages, due to spec change
ICU4C: Parse number literals correctly in Number::format
ICU4J: Allow trailing whitespace after complex body, per spec change
ICU4C: Fix bug that was assuming an .input variable can't have a reserved annotation
ICU4C: Fix bug where unsupported '.i' was parsed as an '.input'
ICU4C/ICU4J: Handle markup with space after the initial left curly brace
ICU4C: Check for duplicate variant errors
ICU4C/ICU4J: Handle leading whitespace in complex messages
ICU4J: Treat whitespace after .input keyword as optional
ICU4J: Don't format unannotated number literals as numbers
2024-09-18 07:46:29 -07:00
Tim Chevalier
57ed0a2a53 ICU-22794 MF2: Move .json files for tests into top-level testdata/ directory
Modify ICU4C and ICU4J test readers to handle all tests

Add `ignoreJava` and `ignoreCpp` properties to tests where needed

Includes parser bug fixes:

ICU4J: require a complex-body after declarations

ICU4J: Correctly parse the complex body after an unsupported statement

ICU4J: Handle date params in tests and remove default params for tests

ICU4J: Handle decimal params in tests

ICU4J: Require whitespace before variable/literal in reserved annotation

ICU4J: Require whitespace between options

ICU4J: Require a variable-expression in an .input declaration

ICU4J: don't require space between last key and pattern in variant

ICU4J: don't require space between selectors

ICU4J: allow whitespace after '=' in option

ICU4J: parse escape sequences in quoted literals according to grammar

ICU4J: allow whitespace within markup after attributes list
2024-08-08 09:14:44 -07:00