summaryrefslogtreecommitdiff
path: root/test/disabled/script
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-05-09 03:53:41 +0000
committerPaul Phillips <paulp@improving.org>2009-05-09 03:53:41 +0000
commit2ea3b94ee2519e01a3e1658909afeb33e7e9ebe2 (patch)
tree9bb2044c595fe260c352a00cf98bb2ecece50437 /test/disabled/script
parentf7ab13b08e085c3bf94d857fc9648ee724e4cb08 (diff)
downloadscala-2ea3b94ee2519e01a3e1658909afeb33e7e9ebe2.tar.gz
scala-2ea3b94ee2519e01a3e1658909afeb33e7e9ebe2.tar.bz2
scala-2ea3b94ee2519e01a3e1658909afeb33e7e9ebe2.zip
Organized disabled directory so it works with p...
Organized disabled directory so it works with partest. You can run ./partest --srcpath disabled to run the tests in that location. Fixed a few tests in disabled and pending and moved to files.
Diffstat (limited to 'test/disabled/script')
-rw-r--r--test/disabled/script/fact.args1
-rwxr-xr-xtest/disabled/script/fact.bat17
-rw-r--r--test/disabled/script/fact.check1
-rw-r--r--test/disabled/script/fact.scala30
4 files changed, 49 insertions, 0 deletions
diff --git a/test/disabled/script/fact.args b/test/disabled/script/fact.args
new file mode 100644
index 0000000000..7813681f5b
--- /dev/null
+++ b/test/disabled/script/fact.args
@@ -0,0 +1 @@
+5 \ No newline at end of file
diff --git a/test/disabled/script/fact.bat b/test/disabled/script/fact.bat
new file mode 100755
index 0000000000..bee0ba25c6
--- /dev/null
+++ b/test/disabled/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/disabled/script/fact.check b/test/disabled/script/fact.check
new file mode 100644
index 0000000000..22aa60821e
--- /dev/null
+++ b/test/disabled/script/fact.check
@@ -0,0 +1 @@
+fact(5) = 120
diff --git a/test/disabled/script/fact.scala b/test/disabled/script/fact.scala
new file mode 100644
index 0000000000..d48dac6f0f
--- /dev/null
+++ b/test/disabled/script/fact.scala
@@ -0,0 +1,30 @@
+#!/bin/sh
+# fact - A simple Scala script that prints out the factorial of
+# the argument specified on the command line.
+
+cygwin=false;
+case "`uname`" in
+ CYGWIN*) cygwin=true ;;
+esac
+
+SOURCE="$0";
+if $cygwin; then
+ if [ "$OS" = "Windows_NT" ] && cygpath -m .>/dev/null 2>/dev/null ; then
+ format=mixed
+ else
+ format=windows
+ fi
+ SOURCE=`cygpath --$format "$SOURCE"`;
+fi
+
+exec scala -nocompdaemon "$SOURCE" "$@"
+!#
+
+
+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))