From 3f816915ab82fc82c64c39b03085b787aec89f60 Mon Sep 17 00:00:00 2001 From: David Gregory <2992938+DavidGregory084@users.noreply.github.com> Date: Mon, 3 Jun 2024 01:02:17 +0100 Subject: [PATCH] Add equals and toString tests for Doc.Entry --- src/main/java/com/opencastsoftware/prettier4j/Doc.java | 4 ++-- .../java/com/opencastsoftware/prettier4j/DocTest.java | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/opencastsoftware/prettier4j/Doc.java b/src/main/java/com/opencastsoftware/prettier4j/Doc.java index 6bf0f80..5be4ab4 100644 --- a/src/main/java/com/opencastsoftware/prettier4j/Doc.java +++ b/src/main/java/com/opencastsoftware/prettier4j/Doc.java @@ -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; @@ -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); } diff --git a/src/test/java/com/opencastsoftware/prettier4j/DocTest.java b/src/test/java/com/opencastsoftware/prettier4j/DocTest.java index c33af4f..8b1c39a 100644 --- a/src/test/java/com/opencastsoftware/prettier4j/DocTest.java +++ b/src/test/java/com/opencastsoftware/prettier4j/DocTest.java @@ -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();