equal
deleted
inserted
replaced
14 # marks for main part 2 |
14 # marks for main part 2 |
15 |
15 |
16 # compilation tests |
16 # compilation tests |
17 |
17 |
18 function scala_compile { |
18 function scala_compile { |
19 (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -Xprint:parser "$1" 2> c$out 1> c$out) |
19 (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli compile "$1" 2> c$out 1> c$out) |
20 } |
20 } |
21 |
21 |
22 # functional tests |
22 # functional tests |
23 |
23 |
24 function scala_assert { |
24 function scala_assert { |
25 (ulimit -t 35; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" -- "$2" -e "" 2> /dev/null 1> /dev/null) |
25 (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala-cli -i "$1" "$2" -e "urbanmain()" 2> /dev/null 1> /dev/null) |
26 } |
26 } |
27 |
27 |
28 # purity test |
28 # purity test |
29 function scala_vars { |
29 function scala_vars { |
30 (sed 's/immutable/ok/g' c$out > cb$out; |
30 (sed 's/immutable/ok/g' c$out > cb$out; |
31 egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null) |
31 egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null) |
32 } |
32 } |
40 then |
40 then |
41 echo -e " --> success" >> $out |
41 echo -e " --> success" >> $out |
42 tsts0=$(( 0 )) |
42 tsts0=$(( 0 )) |
43 else |
43 else |
44 echo -e " --> SCALA DID NOT RUN wordle.scala\n" >> $out |
44 echo -e " --> SCALA DID NOT RUN wordle.scala\n" >> $out |
|
45 echo -e " --> try running scala-cli compile wordle.scala on your own computer\n" >> $out |
45 tsts0=$(( 1 )) |
46 tsts0=$(( 1 )) |
46 fi |
47 fi |
47 |
48 |
48 # var, .par return, ListBuffer test |
49 # var, .par return, ListBuffer test |
49 # |
50 # |