mirror of
https://github.com/apache/commons-lang.git
synced 2025-02-08 11:05:09 +00:00
Add missing test assertions
This commit is contained in:
parent
c6ce19a068
commit
be1081a066
@ -32,6 +32,7 @@
|
|||||||
import java.util.TimeZone;
|
import java.util.TimeZone;
|
||||||
|
|
||||||
import org.apache.commons.lang3.AbstractLangTest;
|
import org.apache.commons.lang3.AbstractLangTest;
|
||||||
|
import org.apache.commons.lang3.time.DurationFormatUtils.Token;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junitpioneer.jupiter.DefaultTimeZone;
|
import org.junitpioneer.jupiter.DefaultTimeZone;
|
||||||
|
|
||||||
@ -644,8 +645,12 @@ public void testLexx() {
|
|||||||
|
|
||||||
// test failures in equals
|
// test failures in equals
|
||||||
final DurationFormatUtils.Token token = createTokenWithCount(DurationFormatUtils.y, 4);
|
final DurationFormatUtils.Token token = createTokenWithCount(DurationFormatUtils.y, 4);
|
||||||
|
assertEquals(token, token);
|
||||||
|
assertEquals(token.hashCode(), token.hashCode());
|
||||||
assertNotEquals(token, new Object(), "Token equal to non-Token class. ");
|
assertNotEquals(token, new Object(), "Token equal to non-Token class. ");
|
||||||
assertNotEquals(token, createTokenWithCount("", 1), "Token equal to Token with wrong value class. ");
|
final Token token2 = createTokenWithCount("", 1);
|
||||||
|
assertNotEquals(token, token2, "Token equal to Token with wrong value class. ");
|
||||||
|
assertNotEquals(token.hashCode(), token2.hashCode());
|
||||||
assertNotEquals(token, createTokenWithCount(DurationFormatUtils.y, 1), "Token equal to Token with different count. ");
|
assertNotEquals(token, createTokenWithCount(DurationFormatUtils.y, 1), "Token equal to Token with different count. ");
|
||||||
final DurationFormatUtils.Token numToken = createTokenWithCount("1", 4);
|
final DurationFormatUtils.Token numToken = createTokenWithCount("1", 4);
|
||||||
assertEquals(numToken, numToken, "Token with Number value not equal to itself. ");
|
assertEquals(numToken, numToken, "Token with Number value not equal to itself. ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user