summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2008-11-01 20:01:29 +0000
committermichelou <michelou@epfl.ch>2008-11-01 20:01:29 +0000
commitc50dd4e212fff79020f0100d1a81ab64b599251f (patch)
tree70a9254b69b4f1175b378b7e969d0188fd701759 /test
parent6599832787acde26f4b621c6e19ffe2bbbd180a1 (diff)
downloadscala-c50dd4e212fff79020f0100d1a81ab64b599251f.tar.gz
scala-c50dd4e212fff79020f0100d1a81ab64b599251f.tar.bz2
scala-c50dd4e212fff79020f0100d1a81ab64b599251f.zip
fixed "script" tests on Windows (Cygwin+DOS)
Diffstat (limited to 'test')
-rwxr-xr-xtest/files/jvm/mkLibNatives.bat2
-rwxr-xr-xtest/files/script/fact.bat17
-rwxr-xr-xtest/files/script/second.bat3
-rwxr-xr-xtest/files/script/t1015.bat12
-rwxr-xr-xtest/files/script/t1017.bat15
-rwxr-xr-xtest/files/script/utf8.bat11
6 files changed, 59 insertions, 1 deletions
diff --git a/test/files/jvm/mkLibNatives.bat b/test/files/jvm/mkLibNatives.bat
index 7fc88f91c3..045afe0ca2 100755
--- a/test/files/jvm/mkLibNatives.bat
+++ b/test/files/jvm/mkLibNatives.bat
@@ -16,7 +16,7 @@ set STDOUT=NUL
if %DEBUG%==1 set STDOUT=CON
set CLASS_NAME=Test$
-set CLASS_DIR=natives-jvm
+set CLASS_DIR=.
set OBJ_NAME=natives
set LIB_NAME=natives-32
diff --git a/test/files/script/fact.bat b/test/files/script/fact.bat
new file mode 100755
index 0000000000..bee0ba25c6
--- /dev/null
+++ b/test/files/script/fact.bat
@@ -0,0 +1,17 @@
+::#!
+:: fact - A simple Scala batch file that prints out the factorial
+:: of the argument specified on the command line.
+
+@echo off
+call scala -nocompdaemon %0 %*
+goto :eof
+::!#
+
+
+val x = argv(0).toInt
+
+def fact(x: Int):Int =
+ if(x==0) 1
+ else x*fact(x-1)
+
+Console.println("fact(" + x + ") = " + fact(x))
diff --git a/test/files/script/second.bat b/test/files/script/second.bat
new file mode 100755
index 0000000000..222372d543
--- /dev/null
+++ b/test/files/script/second.bat
@@ -0,0 +1,3 @@
+@echo off
+
+scala -nocompdaemon -e "println(\"My second argument is \" + args(1))" arg1 arg2
diff --git a/test/files/script/t1015.bat b/test/files/script/t1015.bat
new file mode 100755
index 0000000000..7475313d7e
--- /dev/null
+++ b/test/files/script/t1015.bat
@@ -0,0 +1,12 @@
+::#!
+:: t1015 - <description>.
+
+@echo off
+call scala -nocompdaemon %0 %*
+goto :eof
+::!#
+
+case class Test(one : Int, two : Int)
+object Test{
+ def apply(one : Int): Test = Test(one, 2);
+}
diff --git a/test/files/script/t1017.bat b/test/files/script/t1017.bat
new file mode 100755
index 0000000000..369dbd2aca
--- /dev/null
+++ b/test/files/script/t1017.bat
@@ -0,0 +1,15 @@
+::#!
+::# t1017 - <description>.
+
+@echo off
+call scala -nocompdaemon %0 %*
+goto :eof
+::!#
+
+def foo = {
+ bar
+}
+
+var x = 1
+
+def bar = 1
diff --git a/test/files/script/utf8.bat b/test/files/script/utf8.bat
new file mode 100755
index 0000000000..8bc5c886f7
--- /dev/null
+++ b/test/files/script/utf8.bat
@@ -0,0 +1,11 @@
+::#!
+:: utf8 - <description>.
+
+@echo off
+call scala -nocompdaemon %0 %*
+goto :eof
+::!#
+
+/*Comment Комментарий*/
+Console.println("QWERTY");
+Console.println("ЙЦУКЕН");