diff options
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/array-addition.check | 4 | ||||
-rw-r--r-- | tests/run/array-addition.scala | 11 |
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/run/array-addition.check b/tests/run/array-addition.check new file mode 100644 index 000000000..7bfbd9c71 --- /dev/null +++ b/tests/run/array-addition.check @@ -0,0 +1,4 @@ +Array(1, 2, 3, 4) +Array(1, 2, 3, 4) +Array(1) +Array(1) diff --git a/tests/run/array-addition.scala b/tests/run/array-addition.scala new file mode 100644 index 000000000..8def48e85 --- /dev/null +++ b/tests/run/array-addition.scala @@ -0,0 +1,11 @@ +object Test { + def prettyPrintArray(x: Array[_]) = println("Array(" + x.mkString(", ") + ")") + + def main(args: Array[String]): Unit = { + prettyPrintArray(Array(1,2,3) :+ 4) + prettyPrintArray(1 +: Array(2,3,4)) + prettyPrintArray(Array() :+ 1) + prettyPrintArray(1 +: Array()) + } +} + |