From 9ab24e38466cdcbd8611458f98c671e7bd14366a Mon Sep 17 00:00:00 2001 From: Jan Ouwens Date: Wed, 3 Apr 2024 12:46:33 +0200 Subject: [PATCH] Adds test case for bounded wildcard generics --- .../integration/extended_contract/RecordsTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/equalsverifier-16/src/test/java/nl/jqno/equalsverifier/integration/extended_contract/RecordsTest.java b/equalsverifier-16/src/test/java/nl/jqno/equalsverifier/integration/extended_contract/RecordsTest.java index b96740263..36d6fb4c6 100644 --- a/equalsverifier-16/src/test/java/nl/jqno/equalsverifier/integration/extended_contract/RecordsTest.java +++ b/equalsverifier-16/src/test/java/nl/jqno/equalsverifier/integration/extended_contract/RecordsTest.java @@ -4,6 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import java.io.Serializable; import java.util.Objects; import nl.jqno.equalsverifier.EqualsVerifier; import nl.jqno.equalsverifier.Warning; @@ -141,6 +142,11 @@ public void succeed_whenRecordValidatesInput_givenValidPrefabValues() { .verify(); } + @Test + public void succeed_whenRecord() { + EqualsVerifier.forClass(WildcardGenericRecordContainer.class).verify(); + } + record SimpleRecord(int i, String s) {} private record PrivateSimpleRecord(int i, String s) {} @@ -247,4 +253,8 @@ record ValidatingConstructorRecord(String s) { } } } + + record BoundedGenericRecord(T t) {} + + record WildcardGenericRecordContainer(BoundedGenericRecord bgr) {} }