summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiroslav Šulc <fordfrog@gentoo.org>2023-12-06 10:33:19 +0100
committerMiroslav Šulc <fordfrog@gentoo.org>2023-12-06 10:33:28 +0100
commit58cc509cc783fe40679fd4d88e0f8b647dba0275 (patch)
treec5efe55aa32c0d4e893507fe85b96afb147e01e0 /dev-java/gson
parentdev-java/gson: add 2.10.2_pre20231128 (diff)
downloadgentoo-58cc509cc783fe40679fd4d88e0f8b647dba0275.tar.gz
gentoo-58cc509cc783fe40679fd4d88e0f8b647dba0275.tar.bz2
gentoo-58cc509cc783fe40679fd4d88e0f8b647dba0275.zip
dev-java/gson: improved test patch in 2.10.2_pre20231128
Signed-off-by: Miroslav Šulc <fordfrog@gentoo.org>
Diffstat (limited to 'dev-java/gson')
-rw-r--r--dev-java/gson/files/gson-2.10.2-GsonVersionDiagnosticsTest.patch43
1 files changed, 8 insertions, 35 deletions
diff --git a/dev-java/gson/files/gson-2.10.2-GsonVersionDiagnosticsTest.patch b/dev-java/gson/files/gson-2.10.2-GsonVersionDiagnosticsTest.patch
index 097e5f0098a9..9feeb0aa3797 100644
--- a/dev-java/gson/files/gson-2.10.2-GsonVersionDiagnosticsTest.patch
+++ b/dev-java/gson/files/gson-2.10.2-GsonVersionDiagnosticsTest.patch
@@ -1,40 +1,13 @@
-There were 2 failures:
-1) testAssertionErrorInDeserializationPrintsVersion(com.google.gson.functional.GsonVersionDiagnosticsTest)
-expected to match: (\(GSON \d\.\d+\.\d)(?:[-.][A-Z]+)?\)$
-but was : (GSON 2.10.2_pre20231128)
- at com.google.gson.functional.GsonVersionDiagnosticsTest.ensureAssertionErrorPrintsGsonVersion(GsonVersionDiagnosticsTest.java:91)
- at com.google.gson.functional.GsonVersionDiagnosticsTest.testAssertionErrorInDeserializationPrintsVersion(GsonVersionDiagnosticsTest.java:79)
-2) testAssertionErrorInSerializationPrintsVersion(com.google.gson.functional.GsonVersionDiagnosticsTest)
-expected to match: (\(GSON \d\.\d+\.\d)(?:[-.][A-Z]+)?\)$
-but was : (GSON 2.10.2_pre20231128)
- at com.google.gson.functional.GsonVersionDiagnosticsTest.ensureAssertionErrorPrintsGsonVersion(GsonVersionDiagnosticsTest.java:91)
- at com.google.gson.functional.GsonVersionDiagnosticsTest.testAssertionErrorInSerializationPrintsVersion(GsonVersionDiagnosticsTest.java:71)
+support our versioning schemes
-FAILURES!!!
-Tests run: 1335, Failures: 2
--- a/src/test/java/com/google/gson/functional/GsonVersionDiagnosticsTest.java
+++ b/src/test/java/com/google/gson/functional/GsonVersionDiagnosticsTest.java
-@@ -26,6 +26,7 @@ import com.google.gson.stream.JsonWriter;
- import java.util.regex.Pattern;
- import org.junit.Before;
- import org.junit.Test;
-+import org.junit.Ignore;
+@@ -35,7 +35,7 @@ import org.junit.Test;
+ public class GsonVersionDiagnosticsTest {
+ // We require a patch number, even if it is .0, consistent with https://semver.org/#spec-item-2.
+ private static final Pattern GSON_VERSION_PATTERN =
+- Pattern.compile("(\\(GSON \\d\\.\\d+\\.\\d)(?:[-.][A-Z]+)?\\)$");
++ Pattern.compile("(\\(GSON \\d\\.\\d+\\.\\d)(?:[-.][A-Z]+|_[a-z]+[0-9]+)?\\)$");
- /**
- * Functional tests to validate printing of Gson version on AssertionErrors
-@@ -65,13 +66,13 @@ public class GsonVersionDiagnosticsTest {
- assertThat("(GSON 2.8.5-SNAPSHOT)").matches(GSON_VERSION_PATTERN);
- }
+ private Gson gson;
-- @Test
-+ @Test @Ignore
- public void testAssertionErrorInSerializationPrintsVersion() {
- AssertionError e = assertThrows(AssertionError.class, () -> gson.toJson(new TestType()));
- ensureAssertionErrorPrintsGsonVersion(e);
- }
-
-- @Test
-+ @Test @Ignore
- public void testAssertionErrorInDeserializationPrintsVersion() {
- AssertionError e =
- assertThrows(AssertionError.class, () -> gson.fromJson("{'a':'abc'}", TestType.class));