--- a/core_testing2/docdiff_test.sh Thu Nov 02 11:32:10 2023 +0000
+++ b/core_testing2/docdiff_test.sh Thu Nov 02 12:37:58 2023 +0000
@@ -11,23 +11,22 @@
echo "Below is the feedback for your submission docdiff.scala" >> $out
echo "" >> $out
-
# compilation tests
function scala_compile {
- (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -Xprint:parser "$1" 2> c$out 1> c$out)
+ (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli compile "$1" 2> c$out 1> c$out)
}
# functional tests
function scala_assert {
- (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" -e "" 2> /dev/null 1> /dev/null)
+ (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli -i "$1" "$2" -e "urbanmain()" 2> /dev/null 1> /dev/null)
}
# purity test
-
function scala_vars {
- (egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' c$out 2> /dev/null 1> /dev/null)
+ (sed 's/immutable/ok/g' c$out > cb$out;
+ egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null)
}
@@ -42,6 +41,7 @@
tsts=$(( 0 ))
else
echo -e " --> SCALA DID NOT RUN docdiff.scala\n" >> $out
+ echo -e " --> try running scala-cli compile docdiff.scala on your own computer\n" >> $out
tsts=$(( 1 ))
fi