On Mon, 23 Oct 2023 21:15:44 GMT, Justin Lu <j...@openjdk.org> wrote:
> Please review this PR which adds a test for ChoiceFormat intended to test a > wide range of ChoiceFormat patterns. > > The existing test _Bug4387255_ only tests a singular basic pattern and does > not test for incorrect patterns either. > > The new test checks > > - both correct and incorrect patterns > - the behavior of incorrect patterns that either throw an > IllegalArgumentException or discard the incorrect portion > - the case of formatting with an empty pattern (that leads to empty limits > and formats) test/jdk/java/text/Format/ChoiceFormat/PatternsTest.java line 48: > 46: public class PatternsTest { > 47: > 48: private static final String err1 = Nit: static constants should be uppercased. test/jdk/java/text/Format/ChoiceFormat/PatternsTest.java line 59: > 57: assertDoesNotThrow( ()-> new ChoiceFormat(pattern), > 58: "Valid pattern should not have thrown an exception"); > 59: } For those valid cases, it may be helpful to actually format some edge cases, and check the results, especially for those odd ones. Or compare the parsed arrays. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/16324#discussion_r1369320017 PR Review Comment: https://git.openjdk.org/jdk/pull/16324#discussion_r1369319425