diff --git a/src/test/java/edu/kit/typicalc/model/TreeTest.java b/src/test/java/edu/kit/typicalc/model/TreeTest.java index 2ff3687..baed83a 100644 --- a/src/test/java/edu/kit/typicalc/model/TreeTest.java +++ b/src/test/java/edu/kit/typicalc/model/TreeTest.java @@ -3,12 +3,15 @@ package edu.kit.typicalc.model; import edu.kit.typicalc.model.step.*; import edu.kit.typicalc.model.term.*; import edu.kit.typicalc.model.type.*; +import nl.jqno.equalsverifier.EqualsVerifier; +import nl.jqno.equalsverifier.Warning; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; import java.util.*; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; class TreeTest { @@ -164,4 +167,12 @@ class TreeTest { constraints.add(varRightConstraint); assertEquals(constraints, tree.getConstraints()); } + + @Test + void equalsTest() { + EqualsVerifier.forClass(Tree.class).usingGetClass() + .withIgnoredFields("typeVarFactory", "stepFactory") + .suppress(Warning.NONFINAL_FIELDS) + .verify(); + } } diff --git a/src/test/java/edu/kit/typicalc/model/TypeInferenceResultTest.java b/src/test/java/edu/kit/typicalc/model/TypeInferenceResultTest.java index 693df37..d79484f 100644 --- a/src/test/java/edu/kit/typicalc/model/TypeInferenceResultTest.java +++ b/src/test/java/edu/kit/typicalc/model/TypeInferenceResultTest.java @@ -4,6 +4,7 @@ import edu.kit.typicalc.model.type.FunctionType; import edu.kit.typicalc.model.type.Type; import edu.kit.typicalc.model.type.TypeVariable; import edu.kit.typicalc.model.type.TypeVariableKind; +import nl.jqno.equalsverifier.EqualsVerifier; import org.junit.jupiter.api.Test; import java.util.ArrayList; @@ -71,4 +72,9 @@ class TypeInferenceResultTest { Type expectedType = new FunctionType(A_2, new FunctionType(new FunctionType(A_2, A_5), A_5)); assertEquals(expectedType, result.getType()); } + + @Test + void equalsTest() { + EqualsVerifier.forClass(TypeInferenceResult.class).usingGetClass().verify(); + } } diff --git a/src/test/java/edu/kit/typicalc/model/TypeInfererLetTest.java b/src/test/java/edu/kit/typicalc/model/TypeInfererLetTest.java index 7b1c3c2..c35ce42 100644 --- a/src/test/java/edu/kit/typicalc/model/TypeInfererLetTest.java +++ b/src/test/java/edu/kit/typicalc/model/TypeInfererLetTest.java @@ -6,6 +6,7 @@ import edu.kit.typicalc.model.term.VarTerm; import edu.kit.typicalc.model.type.TypeAbstraction; import edu.kit.typicalc.model.type.TypeVariable; import edu.kit.typicalc.model.type.TypeVariableKind; +import nl.jqno.equalsverifier.EqualsVerifier; import org.junit.jupiter.api.Test; import java.util.*; @@ -45,4 +46,9 @@ class TypeInfererLetTest { = new ArrayList<>(Collections.singletonList(new Constraint(variable2, generated1))); assertEquals(expectedLetConstraints, typeInfererLet.getLetConstraints()); } + + @Test + void equalsTest() { + EqualsVerifier.forClass(TypeInfererLet.class).usingGetClass().verify(); + } } diff --git a/src/test/java/edu/kit/typicalc/model/UnificationTest.java b/src/test/java/edu/kit/typicalc/model/UnificationTest.java index 3ee1b54..814ba70 100644 --- a/src/test/java/edu/kit/typicalc/model/UnificationTest.java +++ b/src/test/java/edu/kit/typicalc/model/UnificationTest.java @@ -4,6 +4,7 @@ import edu.kit.typicalc.model.type.FunctionType; import edu.kit.typicalc.model.type.TypeVariable; import edu.kit.typicalc.model.type.TypeVariableKind; import edu.kit.typicalc.util.Result; +import nl.jqno.equalsverifier.EqualsVerifier; import org.junit.jupiter.api.Test; import java.util.ArrayDeque; @@ -101,4 +102,9 @@ class UnificationTest { UnificationError.INFINITE_TYPE ), new ArrayList<>()), steps.get(1)); } + + @Test + void equalsTest() { + EqualsVerifier.forClass(Unification.class).usingGetClass().verify(); + } }