diff --git a/src/test/java/com/opencastsoftware/prettier4j/DocTest.java b/src/test/java/com/opencastsoftware/prettier4j/DocTest.java index 487914f..2f5761e 100644 --- a/src/test/java/com/opencastsoftware/prettier4j/DocTest.java +++ b/src/test/java/com/opencastsoftware/prettier4j/DocTest.java @@ -841,7 +841,7 @@ void testEquals() { .findFirst().get(); // EqualsVerifier doesn't work with singletons, - // so we can't test Line, LineOrSpace, LineOrEmpty or Empty: + // so we can't test Reset, Line, LineOrSpace, LineOrEmpty or Empty: // it requires prefab values for recursive data types and // those prefab values must not be equal to each other EqualsVerifier diff --git a/src/test/java/com/opencastsoftware/prettier4j/ansi/ColorTest.java b/src/test/java/com/opencastsoftware/prettier4j/ansi/ColorTest.java new file mode 100644 index 0000000..6228114 --- /dev/null +++ b/src/test/java/com/opencastsoftware/prettier4j/ansi/ColorTest.java @@ -0,0 +1,24 @@ +/* + * SPDX-FileCopyrightText: © 2024 Opencast Software Europe Ltd + * SPDX-License-Identifier: Apache-2.0 + */ +package com.opencastsoftware.prettier4j.ansi; + +import com.jparams.verifier.tostring.ToStringVerifier; +import nl.jqno.equalsverifier.EqualsVerifier; +import org.junit.jupiter.api.Test; + +public class ColorTest { + @Test + void testEquals() { + EqualsVerifier.forClasses( + Color.class, Color16.class, + Color256.class, ColorRgb.class) + .usingGetClass().verify(); + } + + @Test + void testToString() { + ToStringVerifier.forClasses(Color16.class, Color256.class, ColorRgb.class).verify(); + } +} diff --git a/src/test/java/com/opencastsoftware/prettier4j/ansi/StylesTest.java b/src/test/java/com/opencastsoftware/prettier4j/ansi/StylesTest.java new file mode 100644 index 0000000..8ab9633 --- /dev/null +++ b/src/test/java/com/opencastsoftware/prettier4j/ansi/StylesTest.java @@ -0,0 +1,23 @@ +package com.opencastsoftware.prettier4j.ansi; + +import com.jparams.verifier.tostring.ToStringVerifier; +import nl.jqno.equalsverifier.EqualsVerifier; +import org.junit.jupiter.api.Test; + +public class StylesTest { + @Test + void testEquals() { + EqualsVerifier.forClasses(Styles.Fg.class, Styles.Bg.class) + .usingGetClass() + .verify(); + } + + @Test + void testToString() { + ToStringVerifier.forClasses( + Styles.Fg.class, Styles.Bg.class, Styles.Bold.class, + Styles.Faint.class, Styles.Italic.class, Styles.Underline.class, + Styles.Blink.class, Styles.Inverse.class, Styles.Strikethrough.class) + .withIgnoredFields("shiftValue").verify(); + } +}