Prohibited NaN steps.

This commit is contained in:
Evgeny Gerashchenko
2013-02-13 16:21:20 +04:00
parent 4043491ad2
commit 021496c07d
4 changed files with 18 additions and 0 deletions
@@ -184,5 +184,15 @@ public class RangeTest {
failsWith(javaClass<IllegalArgumentException>()) { 'z' downTo 'a' step -2 }
failsWith(javaClass<IllegalArgumentException>()) { 0.0 downTo -5.0 step -0.5 }
failsWith(javaClass<IllegalArgumentException>()) { 0.0.toFloat() downTo -5.0.toFloat() step -0.5.toFloat() }
// NaN increment or step
failsWith(javaClass<IllegalArgumentException>()) { DoubleProgression(0.0, 5.0, jDouble.NaN) }
failsWith(javaClass<IllegalArgumentException>()) { FloatProgression(0.0.toFloat(), 5.0.toFloat(), jFloat.NaN) }
failsWith(javaClass<IllegalArgumentException>()) { 0.0..5.0 step jDouble.NaN }
failsWith(javaClass<IllegalArgumentException>()) { 0.0.toFloat()..5.0.toFloat() step jFloat.NaN }
failsWith(javaClass<IllegalArgumentException>()) { 5.0 downTo 0.0 step jDouble.NaN }
failsWith(javaClass<IllegalArgumentException>()) { 5.0.toFloat() downTo 0.0.toFloat() step jFloat.NaN }
}
}