summaryrefslogtreecommitdiff
path: root/test/files/jvm/bigints.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-05-19 20:06:19 +0000
committerPaul Phillips <paulp@improving.org>2011-05-19 20:06:19 +0000
commit4afa092314487c0095ff9fd5756d05340f6150b0 (patch)
treed3cf421e67192041f78858fe10735505f4891b3c /test/files/jvm/bigints.scala
parent7595671ec3929aa4ac978826521300a900250214 (diff)
downloadscala-4afa092314487c0095ff9fd5756d05340f6150b0.tar.gz
scala-4afa092314487c0095ff9fd5756d05340f6150b0.tar.bz2
scala-4afa092314487c0095ff9fd5756d05340f6150b0.zip
Removes SUnit (long deprecated!) from the stand...
Removes SUnit (long deprecated!) from the standard library. the relatively small number of partest tests in Scala's suite that were still using SUnit now either just use regular asserts, or they print stuff that partest checks with a .check file. Also fixed some bad indentation, removed ancient useless-looking commented-out code, etc. Contributed by Seth Tisue (way to go seth) no review.
Diffstat (limited to 'test/files/jvm/bigints.scala')
-rw-r--r--test/files/jvm/bigints.scala49
1 files changed, 20 insertions, 29 deletions
diff --git a/test/files/jvm/bigints.scala b/test/files/jvm/bigints.scala
index f4ca2d17a3..4f6a06b7e1 100644
--- a/test/files/jvm/bigints.scala
+++ b/test/files/jvm/bigints.scala
@@ -1,41 +1,32 @@
-//############################################################################
-// BigInt, BigDecimal
-//############################################################################
-
-//############################################################################
-
-import testing.SUnit._
-
-/** Test the Scala implementation of class <code>scala.BigDecimal</code>.
+/** Test the Scala implementation of classes <code>scala.BigInt</code>
+* and <code>scala.BigDecimal</code>.
*
* @author Stephane Micheloud
*/
-object Test extends TestConsoleMain {
- def suite = new TestSuite(
- Test_BigInt,
- Test_BigDecimal
- )
+object Test {
+ def main(args: Array[String]) {
+ Test_BigInt.runTest()
+ Test_BigDecimal.runTest()
+ }
}
-object Test_BigInt extends TestCase("BigInt") with Assert {
- override def enableStackTrace = false
- override def runTest {
+object Test_BigInt {
+ def runTest() {
import BigInt._
val x: BigInt = 1
val y = x + 1
val z = 1 + y
- assertEquals("int_add_bigint", 1+y, y+1)
- assertEquals("int_sub_bigint", 1-y, -(y-1))
- assertEquals("int_mul_bigint", 2*x*y, y*x*2)
- assertTrue("z_<=_3", z <= 3)
- assertFalse("3_<_z", 3 < z)
+ println("int_add_bigint = " + (1+y, y+1))
+ println("int_sub_bigint = " + (1-y,-(y-1)))
+ println("int_mul_bigint = " + (2*x*y, y*x*2))
+ println("z <= 3 = " + (z <= 3))
+ println("3 < z = " + (3 < z))
}
}
-object Test_BigDecimal extends TestCase("BigDecimal") with Assert {
- override def enableStackTrace = false
- override def runTest {
+object Test_BigDecimal {
+ def runTest() {
import scala.BigDecimal, BigDecimal._
val xi: BigDecimal = 1
@@ -47,14 +38,14 @@ object Test_BigDecimal extends TestCase("BigDecimal") with Assert {
val x: BigDecimal = 1
val y = x + 1
val z = 1 + y
- assertTrue("z_<=_3", z <= 3)
- assertFalse("3_<_z", 3 < z)
+ println("z <= 3 = " + (z <= 3))
+ println("3 < z = " + (3 < z))
val a: BigDecimal= Math.MAX_LONG
val b: BigDecimal = 1
val c = a - b
- assertFalse("c_>_MAX_LONG", c > Math.MAX_LONG)
- assertTrue("c_<=_MAX_LONG", c <= Math.MAX_LONG)
+ println("c > MAX_LONG = " + (c > Math.MAX_LONG))
+ println("c <= MAX_LONG = " + (c <= Math.MAX_LONG))
}
}