Skip to content

Commit

Permalink
Add a test that verifies this bug
Browse files Browse the repository at this point in the history
  • Loading branch information
niloc132 committed Nov 20, 2024
1 parent c2229e7 commit c328d1d
Showing 1 changed file with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ public int compareTo(InnerRecord other) {
*/
record RecordWithReferenceType(TopLevelRecord refType){}

record RecordWithCtors(String a, int b) {
// public RecordWithCtors {
// }
public RecordWithCtors(int a, int b) {
this(String.valueOf(a), b);
}
}

public void testRecordClasses() {
/**
* Sample local record.
Expand Down Expand Up @@ -188,6 +196,11 @@ public String toString() {
assertFalse(sameA.hashCode() == different.hashCode());

assertFalse(sameA.equals(null));

RecordWithCtors hasCtors = new RecordWithCtors(1, 2);
assertEquals("1", hasCtors.a());
assertEquals(2, hasCtors.b());
assertEquals(new RecordWithCtors("1", 2), hasCtors);
}

/**
Expand Down

0 comments on commit c328d1d

Please sign in to comment.