commit:     58cc509cc783fe40679fd4d88e0f8b647dba0275
Author:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  6 09:33:19 2023 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Wed Dec  6 09:33:28 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=58cc509c

dev-java/gson: improved test patch in 2.10.2_pre20231128

Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 .../gson-2.10.2-GsonVersionDiagnosticsTest.patch   | 43 ++++------------------
 1 file 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));

Reply via email to