Skip to content

Commit 59ace7a

Browse files
committed
Cover another missing equality test case for ModuleCandidate objects
1 parent 74767ef commit 59ace7a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

java-compiler-testing/src/test/java/io/github/ascopes/jct/tests/unit/utils/ModuleDiscovererTest.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,11 +232,17 @@ void inequalCandidatesAreConsideredInequal() {
232232

233233
// When
234234
var candidate1 = new ModuleCandidate(name1, path1, ref1.descriptor());
235-
var candidate2 = new ModuleCandidate(name2, path2, ref2.descriptor());
235+
var candidate2 = new ModuleCandidate(name2, path1, ref2.descriptor());
236+
var candidate3 = new ModuleCandidate(name1, path2, ref1.descriptor());
237+
var candidate4 = new ModuleCandidate(name2, path2, ref2.descriptor());
236238

237239
// Then
238240
assertThat(candidate1).isNotEqualTo(candidate2);
239241
assertThat(candidate1).doesNotHaveSameHashCodeAs(candidate2);
242+
assertThat(candidate1).isNotEqualTo(candidate3);
243+
assertThat(candidate1).doesNotHaveSameHashCodeAs(candidate3);
244+
assertThat(candidate1).isNotEqualTo(candidate4);
245+
assertThat(candidate1).doesNotHaveSameHashCodeAs(candidate4);
240246
}
241247

242248
@DisplayName("Candidates are not equal to null")

0 commit comments

Comments
 (0)