summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sources/msil/scala/runtime/compat/StringBuilder.scala22
-rw-r--r--sources/scala/runtime/compat/StringBuilder.scala22
-rw-r--r--test/files/run/Course-2002-03-msil.check67
-rw-r--r--test/files/run/Course-2002-09-msil.check50
4 files changed, 161 insertions, 0 deletions
diff --git a/sources/msil/scala/runtime/compat/StringBuilder.scala b/sources/msil/scala/runtime/compat/StringBuilder.scala
new file mode 100644
index 0000000000..4154c0fb3a
--- /dev/null
+++ b/sources/msil/scala/runtime/compat/StringBuilder.scala
@@ -0,0 +1,22 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2002-2005, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+// $Id$
+
+
+package scala.runtime.compat;
+
+class StringBuilder {
+ val str = new System.Text.StringBuilder();
+ def append(x: Any): StringBuilder = {
+ str.Append(x);
+ this
+ }
+ def length(): Int = str.Length;
+ override def toString() = str.toString();
+}
diff --git a/sources/scala/runtime/compat/StringBuilder.scala b/sources/scala/runtime/compat/StringBuilder.scala
new file mode 100644
index 0000000000..f2dbab804c
--- /dev/null
+++ b/sources/scala/runtime/compat/StringBuilder.scala
@@ -0,0 +1,22 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2002-2005, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+\* */
+
+// $Id$
+
+
+package scala.runtime.compat;
+
+class StringBuilder {
+ val str = new StringBuffer();
+ def append(x: Any): StringBuilder = {
+ str.append(x);
+ this
+ }
+ def length(): Int = str.length();
+ override def toString() = str.toString();
+}
diff --git a/test/files/run/Course-2002-03-msil.check b/test/files/run/Course-2002-03-msil.check
new file mode 100644
index 0000000000..3556893e16
--- /dev/null
+++ b/test/files/run/Course-2002-03-msil.check
@@ -0,0 +1,67 @@
+1
+2
+1/2
+5/6
+
+1/3
+5/7
+3/2
+66/42
+
+1/3
+5/7
+3/2
+11/7
+
+11/7
+7/11
+11/7
+11/7
+
+13/36
+
+False
+True
+True
+False
+
+set0 = []
+set1 = [1]
+set2 = [1,2]
+set3 = [1,2,3]
+set4 = [1,2,3,4]
+
+set2 contains the following elements:
+1
+2
+
+set3 contains the following elements:
+1
+2
+3
+
+set4 contains the following elements:
+1
+2
+3
+4
+
+2 <- set2: True
+3 <- set2: False
+
+setx = [-10,-1,0,3,5,21]
+setx * 2 = [-20,-2,0,6,10,42]
+
+setx = [-10,-1,0,3,5,21]
+sety = [-9,-5,-1,0,3,7,8]
+setx & sety = [-1,0,3]
+sety & setx = [-1,0,3]
+setx > 0 = [3,5,21]
+sety > 0 = [3,7,8]
+setx & sety = [-1,0,3]
+sety & setx = [-1,0,3]
+
+1/1
+1/1
+1/1
+
diff --git a/test/files/run/Course-2002-09-msil.check b/test/files/run/Course-2002-09-msil.check
new file mode 100644
index 0000000000..c921361db7
--- /dev/null
+++ b/test/files/run/Course-2002-09-msil.check
@@ -0,0 +1,50 @@
+Probe: f = 32
+Probe: c = 0
+Probe: f = ?
+Probe: c = ?
+
+Probe: f = 212
+Probe: c = 100
+Probe: f = ?
+Probe: c = ?
+
+Probe: c = 0
+Probe: f = 32
+Probe: c = ?
+Probe: f = ?
+
+Probe: c = 100
+Probe: f = 212
+Probe: c = ?
+Probe: f = ?
+
+0 Celsius -> 32 Fahrenheits
+100 Celsius -> 212 Fahrenheits
+32 Fahrenheits -> 0 Celsius
+212 Fahrenheits -> 100 Celsius
+
+a = ?, b = ?, c = ? => ? * ? = ?
+a = 2, b = ?, c = ? => 2 * ? = ?
+a = ?, b = 3, c = ? => ? * 3 = ?
+a = ?, b = ?, c = 6 => ? * ? = 6
+a = 2, b = 3, c = ? => 2 * 3 = 6
+a = 2, b = ?, c = 6 => 2 * 3 = 6
+a = ?, b = 3, c = 6 => 2 * 3 = 6
+a = 2, b = 3, c = 6 => 2 * 3 = 6
+
+a = 0, b = ?, c = ? => 0 * ? = 0
+a = ?, b = 0, c = ? => ? * 0 = 0
+a = ?, b = ?, c = 0 => ? * ? = 0
+a = 0, b = 7, c = ? => 0 * 7 = 0
+a = 7, b = 0, c = ? => 7 * 0 = 0
+a = 0, b = 0, c = ? => 0 * 0 = 0
+a = 0, b = ?, c = 0 => 0 * ? = 0
+a = ?, b = 0, c = 0 => ? * 0 = 0
+a = 0, b = 7, c = 0 => 0 * 7 = 0
+a = 7, b = 0, c = 0 => 7 * 0 = 0
+a = 0, b = 0, c = 0 => 0 * 0 = 0
+
+a = 3, b = 4 => c = 5
+a = 3, c = 5 => b = 4
+b = 4, c = 5 => a = 3
+