Use Char.MIN_VALUE and MAX_VALUE in tests

This commit is contained in:
Ilya Gorbunov
2018-06-22 21:39:22 +03:00
parent 92e149fa40
commit 5f3a7f0147
8 changed files with 21 additions and 9 deletions
@@ -94,6 +94,15 @@ class NumbersTest {
expect(Float.NEGATIVE_INFINITY) { -Float.MAX_VALUE * 2 }
expect(0.0F) { Float.MIN_VALUE / 2.0F }
}
@Test fun charMinMaxValues() {
assertTrue(Char.MIN_VALUE.toInt() == 0)
assertTrue(Char.MAX_VALUE.toInt() > 0)
// overflow behavior
expect(Char.MIN_VALUE) { Char.MAX_VALUE + one }
expect(Char.MAX_VALUE) { Char.MIN_VALUE - one }
}
@Test fun doubleProperties() {
for (value in listOf(1.0, 0.0, Double.MIN_VALUE, Double.MAX_VALUE))