moved the stdlib tests into the same directory as the stdlib, so it works a bit better with maven support in IDEA

This commit is contained in:
James Strachan
2012-03-14 16:14:04 +00:00
parent 9cd21d3a4d
commit 7ef65c0099
35 changed files with 2 additions and 2 deletions
+40
View File
@@ -0,0 +1,40 @@
package test.collections;
import kotlin.math.*
import java.math.BigInteger
import java.math.BigDecimal
import kotlin.test.*
import junit.framework.TestCase
class MathTest : TestCase() {
fun testBigInteger() {
val a = BigInteger("2")
val b = BigInteger("3")
assertEquals(BigInteger("5"), a + b)
assertEquals(BigInteger("-1"), a - b)
assertEquals(BigInteger("6"), a * b)
assertEquals(BigInteger("0"), a / b)
assertEquals(BigInteger("-2"), -a)
assertEquals(BigInteger("1"), -a % b)
assertEquals(BigInteger("-2"), -a remainder b)
}
fun testBigDecimal() {
val a = BigDecimal("2")
val b = BigDecimal("3")
assertEquals(BigDecimal("5"), a + b)
assertEquals(BigDecimal("-1"), a - b)
assertEquals(BigDecimal("6"), a * b)
assertEquals(BigDecimal("2"), BigDecimal("4") / a)
assertEquals(BigDecimal("-2"), -a)
assertEquals(BigDecimal("-2"), -a % b)
}
}
fun main(args: Array<String>) {
MathTest().testBigInteger()
MathTest().testBigDecimal()
}