Skip to content

Commit

Permalink
Add equals and toString tests for Doc.Entry
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidGregory084 committed Jun 3, 2024
1 parent b533634 commit 3f81691
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/com/opencastsoftware/prettier4j/Doc.java
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,7 @@ public static Doc group(Doc doc) {
return alternatives(doc.flatten(), doc);
}

private static class Entry {
static final class Entry {
private final int indent;
private final Doc margin;
private final Doc doc;
Expand Down Expand Up @@ -1562,7 +1562,7 @@ public String toString() {
}
}

private static Entry entry(int indent, Doc margin, Doc doc) {
static Entry entry(int indent, Doc margin, Doc doc) {
return new Entry(indent, margin, doc);
}

Expand Down
10 changes: 10 additions & 0 deletions src/test/java/com/opencastsoftware/prettier4j/DocTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,16 @@ void paramIsEquivalentToInlining(
assertThat(parameterized, is(equalTo(inlined)));
}

@Test
void testEntryEquals() {
EqualsVerifier.forClass(Entry.class).usingGetClass().verify();
}

@Test
void testEntryToString() {
ToStringVerifier.forClass(Entry.class).verify();
}

@Test
void testEquals() {
Doc left = docsWithParams().sample();
Expand Down

0 comments on commit 3f81691

Please sign in to comment.