From a2736b826e6b0b62e2826b70797bf05cb3c9906f Mon Sep 17 00:00:00 2001 From: "David P. Baker" Date: Thu, 14 Dec 2023 12:06:31 -0500 Subject: [PATCH] Log failure to parse a type instead of throwing. Fixes #120. --- src/test/java/tests/ConformanceTest.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/test/java/tests/ConformanceTest.java b/src/test/java/tests/ConformanceTest.java index 052b3e4..ff9ebf2 100644 --- a/src/test/java/tests/ConformanceTest.java +++ b/src/test/java/tests/ConformanceTest.java @@ -14,7 +14,6 @@ package tests; -import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.collect.ImmutableList.toImmutableList; import static com.google.common.collect.ImmutableSet.toImmutableSet; import static java.util.Objects.requireNonNull; @@ -35,6 +34,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.Objects; +import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.Stream; @@ -84,6 +84,7 @@ */ @RunWith(JUnit4.class) public final class ConformanceTest { + private static final Logger logger = Logger.getLogger(ConformanceTest.class.getCanonicalName()); private static final ImmutableList OPTIONS = ImmutableList.of( @@ -242,7 +243,10 @@ public String toString() { */ private static String fixType(String type) { Matcher matcher = TYPE.matcher(type); - checkArgument(matcher.matches(), "did not match for \"%s\"", type); + if (!matcher.matches()) { + logger.warning(String.format("type \"%s\" did not match /%s/", type, TYPE.pattern())); + return type; + } String args = matcher.group("args"); String suffix = matcher.group("suffix"); if (args == null && suffix != null) {