summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authormihaylov <mihaylov@epfl.ch>2003-12-01 15:24:49 +0000
committermihaylov <mihaylov@epfl.ch>2003-12-01 15:24:49 +0000
commit0ab1c866962770adc7f6eb08327e2edf4e7473d0 (patch)
treeaea03ca6f8065e7d666301b613672f4187d513e9 /sources
parentc926654a82a48df1cde58f288762976a942ce309 (diff)
downloadscala-0ab1c866962770adc7f6eb08327e2edf4e7473d0.tar.gz
scala-0ab1c866962770adc7f6eb08327e2edf4e7473d0.tar.bz2
scala-0ab1c866962770adc7f6eb08327e2edf4e7473d0.zip
- qualified System to java.lang.System
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/Console.scala4
-rw-r--r--sources/scala/Executable.scala9
-rw-r--r--sources/scala/Predef.scala2
-rw-r--r--sources/scala/testing/UnitTest.scala134
4 files changed, 73 insertions, 76 deletions
diff --git a/sources/scala/Console.scala b/sources/scala/Console.scala
index 90c0b75da4..f3017e6b11 100644
--- a/sources/scala/Console.scala
+++ b/sources/scala/Console.scala
@@ -50,9 +50,9 @@ object Console {
final val REVERSED = "\033[7m";
final val INVISIBLE = "\033[8m";
- private var out: PrintStream = System.out;
+ private var out: PrintStream = java.lang.System.out;
private var in: BufferedReader =
- new BufferedReader(new InputStreamReader(System.in));
+ new BufferedReader(new InputStreamReader(java.lang.System.in));
/** Set the default output stream.
*
diff --git a/sources/scala/Executable.scala b/sources/scala/Executable.scala
index f2ef01d9b5..516a902368 100644
--- a/sources/scala/Executable.scala
+++ b/sources/scala/Executable.scala
@@ -37,13 +37,14 @@ class Executable {
/** The time when execution of this program started.
*/
- val executionStart: Long = System.currentTimeMillis();
+ val executionStart: Long = java.lang.System.currentTimeMillis();
/** The default main method.
*/
def main(args: Array[String]) = {
- if (System.getProperty("scala.time") != null)
- System.out.println("[total " +
- (System.currentTimeMillis() - executionStart) + "ms]");
+ if (java.lang.System.getProperty("scala.time") != null)
+ java.lang.System.out.println("[total " +
+ (java.lang.System.currentTimeMillis()
+ - executionStart) + "ms]");
}
}
diff --git a/sources/scala/Predef.scala b/sources/scala/Predef.scala
index 33c8fa1993..c3c74c7bef 100644
--- a/sources/scala/Predef.scala
+++ b/sources/scala/Predef.scala
@@ -31,7 +31,7 @@ object Predef {
def error(message: String): All = throw new Error(message);
- def exit: scala.Unit = System.exit(0);
+ def exit: scala.Unit = java.lang.System.exit(0);
def synchronized[A](obj: AnyRef)(def body: A): A =
scala.runtime.NativeMonitor.synchronised(obj, body);
diff --git a/sources/scala/testing/UnitTest.scala b/sources/scala/testing/UnitTest.scala
index 4cf6ff3502..fb216982ef 100644
--- a/sources/scala/testing/UnitTest.scala
+++ b/sources/scala/testing/UnitTest.scala
@@ -1,74 +1,70 @@
-package scala.testing ;
+// $Id$
-object UnitTest {
-
- def message_passedOK:Unit = {
- System.out.println("passed ok")
- }
-
- def message_failed( actual:String, expected:String ):Unit = {
- System.out.print("failed! we got");
- System.out.print( "\""+ actual +"\"" );
- System.out.println(" but expected " + expected)
- }
-
- def testEquals[a]( actual: a, expected: a ):Unit = {
-
- if( actual == expected )
- {
- message_passedOK
- }
- else
- {
- message_failed( actual.toString(), expected.toString() )
- }
-
- } // testEquals
-
- def testNotEquals[a]( actual: a, expected: a ):Unit = {
+package scala.testing;
- if( actual != expected )
- {
- message_passedOK
- }
- else
- {
- message_failed( actual.toString(), "something != "+expected.toString() )
- }
-
- } // testNotEquals
-
- def test[b,a]( doit:b => a,
- input: b,
- expected:a ):Unit = {
- val actual = doit( input );
- if( actual == expected )
- {
- message_passedOK
- }
- else
- {
- message_failed( actual.toString(), expected.toString() )
- }
-
- } // test
-
- def test2[c,b,a]( doit:(c,b) => a,
- in1: c,
- in2: b,
- expected:a ):Unit = {
- val actual = doit( in1, in2 );
- if( actual == expected )
- {
- message_passedOK;
- }
- else
- {
- message_failed( actual.toString(), expected.toString() )
- }
+object UnitTest {
- } // test2
+ import java.lang.System;
+
+ def message_passedOK:Unit = {
+ System.out.println("passed ok")
+ }
+
+ def message_failed( actual:String, expected:String ):Unit = {
+ System.out.print("failed! we got");
+ System.out.print( "\""+ actual +"\"" );
+ System.out.println(" but expected " + expected)
+ }
+
+ def testEquals[a]( actual: a, expected: a ):Unit = {
+
+ if( actual == expected )
+ {
+ message_passedOK
+ }
+ else
+ {
+ message_failed( actual.toString(), expected.toString() )
+ }
+
+ } // testEquals
+
+ def testNotEquals[a]( actual: a, expected: a ):Unit = {
+
+ if( actual != expected )
+ {
+ message_passedOK
+ }
+ else
+ {
+ message_failed( actual.toString(), "something != "+expected.toString() )
+ }
+
+ } // testNotEquals
+
+ def test[b,a]( doit:b => a, input: b, expected:a ):Unit = {
+ val actual = doit( input );
+ if( actual == expected )
+ {
+ message_passedOK
+ }
+ else
+ {
+ message_failed( actual.toString(), expected.toString() )
+ }
+ } // test
+
+ def test2[c,b,a]( doit:(c,b) => a, in1: c, in2: b, expected:a ): Unit = {
+ val actual = doit( in1, in2 );
+ if( actual == expected )
+ {
+ message_passedOK;
+ }
+ else
+ {
+ message_failed( actual.toString(), expected.toString() )
+ }
+
+ } // test2
} // unitTest
-
-