marking4/re_test.sh
changeset 288 65731df141a5
parent 246 178438912e5f
child 332 703c7e42bf46
equal deleted inserted replaced
287:c493eaba6018 288:65731df141a5
     3 # to make the script fail safely
     3 # to make the script fail safely
     4 set -euo pipefail
     4 set -euo pipefail
     5 
     5 
     6 out=${1:-output}
     6 out=${1:-output}
     7 
     7 
     8 echo "" > $out
     8 echo -e "" > $out
     9 
     9 
    10 
    10 
    11 echo "Below is the feedback and provisional marks for your submission" >> $out
    11 echo -e "Below is the feedback and provisional marks for your submission" >> $out
    12 echo "for assignment 9 Part 1.  Please note all marks are provisional until" >> $out
    12 echo -e "for the core part of assignment 9.  Please note all marks are provisional until" >> $out
    13 echo "ratified by the assessment board -- this is not an official" >> $out
    13 echo -e "ratified by the assessment board -- this is not an official" >> $out
    14 echo "results transcript." >> $out
    14 echo -e "results transcript." >> $out
    15 echo "" >> $out
    15 echo -e "" >> $out
    16 
    16 
    17 # marks for CW9 part 1
    17 # marks for CW9
    18 marks=$(( 0 ))
    18 marks=$(( 0 ))
    19 
    19 
    20 # compilation tests
    20 # compilation tests
    21 
    21 
    22 function scala_compile {
    22 function scala_compile {
    23     (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc "$1" 2> /dev/null 1> /dev/null)
    23     (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala "$1" 2> /dev/null 1> /dev/null)
    24 }
    24 }
    25 
    25 
    26 # functional tests
    26 # functional tests
    27 
    27 
    28 function scala_assert {
    28 function scala_assert {
    29     (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
    29     (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" 2> /dev/null 1> /dev/null)
    30 }
    30 }
    31 
    31 
    32 function scala_assert_long {
    32 function scala_assert_long {
    33     (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala -nc -i "$1" "$2" -e "" 2> /dev/null 1> /dev/null)
    33     (ulimit -t 60; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" 2> /dev/null 1> /dev/null)
    34 }
    34 }
    35 
    35 
    36 # purity test
    36 # purity test
    37 
    37 
    38 function scala_vars {
    38 function scala_vars {
    40 }
    40 }
    41 
    41 
    42 
    42 
    43 # var, return, ListBuffer test
    43 # var, return, ListBuffer test
    44 #
    44 #
    45 echo "re.scala does not contain vars, returns, Arrays, ListBuffers etc?" | tee -a $out
    45 echo -e "re.scala does not contain vars, returns, Arrays, ListBuffers etc?" | tee -a $out
    46 
    46 
    47 if (scala_vars re.scala)
    47 if (scala_vars re.scala)
    48 then
    48 then
    49   echo "  --> test failed" | tee -a $out
    49   echo -e "  --> FAIL (make triple-sure your program conforms to the required format)\n" | tee -a $out
    50   tsts0=$(( 1 ))
    50   tsts0=$(( 1 ))
    51 else
    51 else
    52   echo "  --> success" | tee -a $out
    52   echo -e "  --> success" | tee -a $out
    53   tsts0=$(( 0 )) 
    53   tsts0=$(( 0 )) 
    54 fi
    54 fi
    55 
    55 
    56 
    56 
    57 # compilation test
    57 # compilation test
    58 if  [ $tsts0 -eq 0 ]
    58 if  [ $tsts0 -eq 0 ]
    59 then    
    59 then    
    60   echo "re.scala runs?" | tee -a $out
    60   echo -e "re.scala runs?" | tee -a $out
    61 
    61 
    62   if (scala_compile re.scala)
    62   if (scala_compile re.scala)
    63   then
    63   then
    64     echo "  --> success" | tee -a $out
    64     echo -e "  --> success" | tee -a $out
    65     tsts1=$(( 0 ))
    65     tsts1=$(( 0 ))
    66   else
    66   else
    67     echo "  --> scala re.scala did not run successfully" | tee -a $out
    67     echo -e "  --> SCALA DID NOT RUN re.scala" | tee -a $out
    68     tsts1=$(( 1 )) 
    68     tsts1=$(( 1 )) 
    69   fi
    69   fi
    70 else
    70 else
    71   tsts1=$(( 1 ))     
    71   tsts1=$(( 1 ))     
    72 fi
    72 fi
    73 
    73 
    74 ### re1 test
    74 ### re1 test
    75 
    75 
    76 if [ $tsts1 -eq 0 ]
    76 if [ $tsts1 -eq 0 ]
    77 then
    77 then
    78   echo " nullable(ZERO) == false" | tee -a $out
    78   echo -e " nullable(ZERO) == false" | tee -a $out
    79   echo " nullable(ONE) == true" | tee -a $out
    79   echo -e " nullable(ONE) == true" | tee -a $out
    80   echo " nullable(CHAR('a')) == false" | tee -a $out
    80   echo -e " nullable(CHAR('a')) == false" | tee -a $out
    81   echo " nullable(ZERO | ONE) == true" | tee -a $out
    81   echo -e " nullable(ZERO | ONE) == true" | tee -a $out
    82   echo " nullable(ZERO | CHAR('a')) == false" | tee -a $out
    82   echo -e " nullable(ZERO | CHAR('a')) == false" | tee -a $out
    83   echo " nullable(ONE ~  ONE) == true" | tee -a $out
    83   echo -e " nullable(ONE ~  ONE) == true" | tee -a $out
    84   echo " nullable(ONE ~ CHAR('a')) == false" | tee -a $out
    84   echo -e " nullable(ONE ~ CHAR('a')) == false" | tee -a $out
    85   echo " nullable(STAR(ZERO)) == true" | tee -a $out
    85   echo -e " nullable(STAR(ZERO)) == true" | tee -a $out
    86   
    86   
    87   if (scala_assert "re.scala" "re_test1.scala")
    87   if (scala_assert "re.scala" "re_test1.scala")
    88   then
    88   then
    89       echo "  --> success" | tee -a $out
    89       echo -e "  --> success" | tee -a $out
    90       marks=$(( marks + 1 ))
    90       marks=$(( marks + 1 ))
    91   else
    91   else
    92       echo "  --> test failed" | tee -a $out
    92       echo -e "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
    93   fi
    93   fi
    94 fi
    94 fi
    95 
    95 
    96 ### re2 test
    96 ### re2 test
    97 
    97 
    98 if [ $tsts1 -eq 0 ]
    98 if [ $tsts1 -eq 0 ]
    99 then
    99 then
   100   echo " der('a', ZERO | ONE) == (ZERO | ZERO)" | tee -a $out
   100   echo -e " der('a', ZERO | ONE) == (ZERO | ZERO)" | tee -a $out
   101   echo " der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALT((ONE | ZERO) ~ CHAR('a'), ONE)" | tee -a $out
   101   echo -e " der('a', (CHAR('a') | ONE) ~ CHAR('a')) == ALT((ONE | ZERO) ~ CHAR('a'), ONE)" | tee -a $out
   102   echo " der('a', (CHAR('a') | CHAR('a')) ~ CHAR('a')) == (ONE | ONE) ~ CHAR('a')" | tee -a $out
   102   echo -e " der('a', (CHAR('a') | CHAR('a')) ~ CHAR('a')) == (ONE | ONE) ~ CHAR('a')" | tee -a $out
   103   echo " der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a')))" | tee -a $out
   103   echo -e " der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a')))" | tee -a $out
   104   echo " der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a')))" | tee -a $out
   104   echo -e " der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a')))" | tee -a $out
   105   echo "" | tee -a $out
   105   echo -e "" | tee -a $out
   106   echo " val r0 = \"a\" ~ \"b\" ~ \"c\"" | tee -a $out
   106   echo -e " val r0 = \"a\" ~ \"b\" ~ \"c\"" | tee -a $out
   107   echo " assert(der('a', r0) == (ONE ~ \"b\") ~ \"c\")" | tee -a $out
   107   echo -e " assert(der('a', r0) == (ONE ~ \"b\") ~ \"c\")" | tee -a $out
   108   echo " assert(der('b', r0) == (ZERO ~ \"b\") ~ \"c\")" | tee -a $out
   108   echo -e " assert(der('b', r0) == (ZERO ~ \"b\") ~ \"c\")" | tee -a $out
   109   echo " assert(der('c', r0) == (ZERO ~ \"b\") ~ \"c\")" | tee -a $out
   109   echo -e " assert(der('c', r0) == (ZERO ~ \"b\") ~ \"c\")" | tee -a $out
   110   echo "" | tee -a $out
   110   echo -e "" | tee -a $out
   111   echo " val r1 = (ONE ~ \"b\") ~ \"c\"" | tee -a $out
   111   echo -e " val r1 = (ONE ~ \"b\") ~ \"c\"" | tee -a $out
   112   echo " assert(der('a', r1) == ((ZERO ~ \"b\") | ZERO) ~ \"c\")" | tee -a $out
   112   echo -e " assert(der('a', r1) == ((ZERO ~ \"b\") | ZERO) ~ \"c\")" | tee -a $out
   113   echo " assert(der('b', r1) == ((ZERO ~ \"b\") | ONE) ~ \"c\")" | tee -a $out
   113   echo -e " assert(der('b', r1) == ((ZERO ~ \"b\") | ONE) ~ \"c\")" | tee -a $out
   114   echo " assert(der('c', r1) == ((ZERO ~ \"b\") | ZERO) ~ \"c\")" | tee -a $out
   114   echo -e " assert(der('c', r1) == ((ZERO ~ \"b\") | ZERO) ~ \"c\")" | tee -a $out
   115   echo "" | tee -a $out
   115   echo -e "" | tee -a $out
   116   echo " val r2 = ((ZERO ~ \"b\") | ONE) ~ \"c\"" | tee -a $out
   116   echo -e " val r2 = ((ZERO ~ \"b\") | ONE) ~ \"c\"" | tee -a $out
   117   echo " assert(der('a', r2) == ((((ZERO ~ \"b\") | ZERO) ~ \"c\") | ZERO))" | tee -a $out
   117   echo -e " assert(der('a', r2) == ((((ZERO ~ \"b\") | ZERO) ~ \"c\") | ZERO))" | tee -a $out
   118   echo " assert(der('b', r2) == ((((ZERO ~ \"b\") | ZERO) ~ \"c\") | ZERO))" | tee -a $out
   118   echo -e " assert(der('b', r2) == ((((ZERO ~ \"b\") | ZERO) ~ \"c\") | ZERO))" | tee -a $out
   119   echo " assert(der('c', r2) == ((((ZERO ~ \"b\") | ZERO) ~ \"c\") | ONE))" | tee -a $out
   119   echo -e " assert(der('c', r2) == ((((ZERO ~ \"b\") | ZERO) ~ \"c\") | ONE))" | tee -a $out
   120 
   120 
   121   if (scala_assert "re.scala" "re_test2.scala")
   121   if (scala_assert "re.scala" "re_test2.scala")
   122   then
   122   then
   123       echo "  --> success" | tee -a $out
   123       echo -e "  --> success" | tee -a $out
   124       marks=$(( marks + 1 ))
   124       marks=$(( marks + 1 ))
   125   else
   125   else
   126       echo "  --> test failed" | tee -a $out
   126       echo -e "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
   127   fi
   127   fi
   128 fi
   128 fi
   129 
   129 
   130 ### re3 test
   130 ### re3 test
   131 
   131 
   132 if [ $tsts1 -eq 0 ]
   132 if [ $tsts1 -eq 0 ]
   133 then
   133 then
   134   echo " simp(ZERO | ONE) == ONE" | tee -a $out
   134   echo -e " simp(ZERO | ONE) == ONE" | tee -a $out
   135   echo " simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE)" | tee -a $out
   135   echo -e " simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE)" | tee -a $out
   136   echo " simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a')" | tee -a $out
   136   echo -e " simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a')" | tee -a $out
   137   echo " simp(((ONE ~ ONE) ~ ONE) ~ CHAR('a')) == CHAR('a')" | tee -a $out
   137   echo -e " simp(((ONE ~ ONE) ~ ONE) ~ CHAR('a')) == CHAR('a')" | tee -a $out
   138   echo " simp(((ONE | ONE) ~ ONE) ~ CHAR('a')) == CHAR('a')" | tee -a $out
   138   echo -e " simp(((ONE | ONE) ~ ONE) ~ CHAR('a')) == CHAR('a')" | tee -a $out
   139   echo " simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO" | tee -a $out
   139   echo -e " simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO" | tee -a $out
   140   echo " simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a')" | tee -a $out
   140   echo -e " simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a')" | tee -a $out
   141   echo " simp(CHAR('a') | CHAR('a')) == CHAR('a')" | tee -a $out
   141   echo -e " simp(CHAR('a') | CHAR('a')) == CHAR('a')" | tee -a $out
   142   echo " simp(CHAR('a') ~ CHAR('a')) == CHAR('a') ~ CHAR('a')" | tee -a $out
   142   echo -e " simp(CHAR('a') ~ CHAR('a')) == CHAR('a') ~ CHAR('a')" | tee -a $out
   143   echo " simp(ONE | CHAR('a')) == (ONE | CHAR('a'))" | tee -a $out
   143   echo -e " simp(ONE | CHAR('a')) == (ONE | CHAR('a'))" | tee -a $out
   144   echo " simp(ALT((CHAR('a') | ZERO) ~ ONE," | tee -a $out
   144   echo -e " simp(ALT((CHAR('a') | ZERO) ~ ONE," | tee -a $out
   145   echo "          ((ONE | CHAR('b')) | CHAR('c')) ~ (CHAR('d') ~ ZERO))) == CHAR('a')" | tee -a $out
   145   echo -e "          ((ONE | CHAR('b')) | CHAR('c')) ~ (CHAR('d') ~ ZERO))) == CHAR('a')" | tee -a $out
   146   echo " simp((ZERO | ((ZERO | ZERO) | (ZERO | ZERO))) ~ ((ONE | ZERO) | ONE ) ~ (CHAR('a'))) == ZERO" | tee -a $out
   146   echo -e " simp((ZERO | ((ZERO | ZERO) | (ZERO | ZERO))) ~ ((ONE | ZERO) | ONE ) ~ (CHAR('a'))) == ZERO" | tee -a $out
   147   echo " simp(ALT(ONE | ONE, ONE | ONE)) == ONE" | tee -a $out
   147   echo -e " simp(ALT(ONE | ONE, ONE | ONE)) == ONE" | tee -a $out
   148   echo " simp(ALT(ZERO | CHAR('a'), CHAR('a') | ZERO)) == CHAR('a')" | tee -a $out
   148   echo -e " simp(ALT(ZERO | CHAR('a'), CHAR('a') | ZERO)) == CHAR('a')" | tee -a $out
   149   echo " simp(ALT(ONE | CHAR('a'), CHAR('a') | ONE)) == ALT(ONE | CHAR('a'), CHAR('a') | ONE)" tee -a $out
   149   echo -e " simp(ALT(ONE | CHAR('a'), CHAR('a') | ONE)) == ALT(ONE | CHAR('a'), CHAR('a') | ONE)" tee -a $out
   150   
   150   
   151   if (scala_assert "re.scala" "re_test3.scala")
   151   if (scala_assert "re.scala" "re_test3.scala")
   152   then
   152   then
   153       echo "  --> success" | tee -a $out
   153       echo -e "  --> success" | tee -a $out
   154       marks=$(( marks + 1 ))
   154       marks=$(( marks + 1 ))
   155   else
   155   else
   156       echo "  --> test failed" | tee -a $out
   156       echo -e "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
   157   fi
   157   fi
   158 fi
   158 fi
   159 
   159 
   160 ### re4 test
   160 ### re4 test
   161 
   161 
   162 if [ $tsts1 -eq 0 ]
   162 if [ $tsts1 -eq 0 ]
   163 then
   163 then
   164   echo " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" | tee -a $out
   164   echo -e " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" | tee -a $out
   165   echo " ders((\"a\" * 5).toList,EVIL) == SEQ(SEQ(STAR(CHAR('a')),STAR(STAR(CHAR('a')))),CHAR('b'))" | tee -a $out
   165   echo -e " ders((\"a\" * 5).toList,EVIL) == SEQ(SEQ(STAR(CHAR('a')),STAR(STAR(CHAR('a')))),CHAR('b'))" | tee -a $out
   166   echo " ders(List('b'),EVIL) == ONE" | tee -a $out
   166   echo -e " ders(List('b'),EVIL) == ONE" | tee -a $out
   167   echo " ders(List('b','b'),EVIL) == ZERO" | tee -a $out
   167   echo -e " ders(List('b','b'),EVIL) == ZERO" | tee -a $out
   168   echo " matcher(EVIL, \"a\" * 5 ++ \"b\") == true" | tee -a $out
   168   echo -e " matcher(EVIL, \"a\" * 5 ++ \"b\") == true" | tee -a $out
   169   echo " matcher(EVIL, \"a\" * 50 ++ \"b\") == true" | tee -a $out
   169   echo -e " matcher(EVIL, \"a\" * 50 ++ \"b\") == true" | tee -a $out
   170   echo " matcher(EVIL, \"a\" * 50) == false" | tee -a $out
   170   echo -e " matcher(EVIL, \"a\" * 50) == false" | tee -a $out
   171   echo " matcher(EVIL, \"b\") == true" | tee -a $out
   171   echo -e " matcher(EVIL, \"b\") == true" | tee -a $out
   172   echo " matcher(EVIL, \"bb\") == false" | tee -a $out
   172   echo -e " matcher(EVIL, \"bb\") == false" | tee -a $out
   173   echo " matcher(\"abc\", \"abc\") == true" | tee -a $out
   173   echo -e " matcher(\"abc\", \"abc\") == true" | tee -a $out
   174   echo " matcher(\"abc\", \"ab\") == true" | tee -a $out
   174   echo -e " matcher(\"abc\", \"ab\") == true" | tee -a $out
   175   echo " matcher((\"ab\" | \"a\") ~ (ONE | \"bc\"), \"abc\") == true" | tee -a $out
   175   echo -e " matcher((\"ab\" | \"a\") ~ (ONE | \"bc\"), \"abc\") == true" | tee -a $out
   176   echo " matcher(ONE, \"\") == true" | tee -a $out
   176   echo -e " matcher(ONE, \"\") == true" | tee -a $out
   177   echo " matcher(ZERO, \"\") == false" | tee -a $out
   177   echo -e " matcher(ZERO, \"\") == false" | tee -a $out
   178   echo " matcher(ONE | CHAR('a'), \"\") == true" | tee -a $out
   178   echo -e " matcher(ONE | CHAR('a'), \"\") == true" | tee -a $out
   179   echo " matcher(ONE | CHAR('a'), \"a\") == true" | tee -a $out
   179   echo -e " matcher(ONE | CHAR('a'), \"a\") == true" | tee -a $out
   180   
   180   
   181   if (scala_assert "re.scala" "re_test4.scala")
   181   if (scala_assert "re.scala" "re_test4.scala")
   182   then
   182   then
   183       echo "  --> success" | tee -a $out
   183       echo -e "  --> success" | tee -a $out
   184       marks=$(( marks + 1 ))
   184       marks=$(( marks + 1 ))
   185   else
   185   else
   186       echo "  --> test failed" | tee -a $out
   186       echo -e "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
   187   fi
   187   fi
   188 fi
   188 fi
   189 
   189 
   190 ### re5 test
   190 ### re5 test
   191 
   191 
   192 
   192 
   193 if [ $tsts1 -eq 0 ]
   193 if [ $tsts1 -eq 0 ]
   194 then
   194 then
   195   echo " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" | tee -a $out  
   195   echo -e " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" | tee -a $out  
   196   echo " size(der('a', der('a', EVIL))) == 28" | tee -a $out
   196   echo -e " size(der('a', der('a', EVIL))) == 28" | tee -a $out
   197   echo " size(der('a', der('a', der('a', EVIL)))) == 58" | tee -a $out
   197   echo -e " size(der('a', der('a', der('a', EVIL)))) == 58" | tee -a $out
   198   echo " size(ders(\"aaaaaa\".toList, EVIL)) == 8" | tee -a $out
   198   echo -e " size(ders(\"aaaaaa\".toList, EVIL)) == 8" | tee -a $out
   199   echo " size(ders((\"a\" * 50).toList, EVIL)) == 8" | tee -a $out
   199   echo -e " size(ders((\"a\" * 50).toList, EVIL)) == 8" | tee -a $out
   200   
   200   
   201   if (scala_assert "re.scala" "re_test5.scala")
   201   if (scala_assert "re.scala" "re_test5.scala")
   202   then
   202   then
   203       echo "  --> success" | tee -a $out
   203       echo -e "  --> success" | tee -a $out
   204       marks=$(( marks + 1 ))
   204       marks=$(( marks + 1 ))
   205   else
   205   else
   206       echo "  --> test failed" | tee -a $out
   206       echo -e "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
   207   fi
   207   fi
   208 fi
   208 fi
   209 
   209 
   210 ### re6 'power' test
   210 ### re6 'power' test
   211 
   211 
   212 
   212 
   213 
   213 
   214 if [ $tsts1 -eq 0 ]
   214 if [ $tsts1 -eq 0 ]
   215 then
   215 then
   216   echo " simp(Iterator.iterate(ONE:Rexp)(r => SEQ(r, ONE | ONE)).drop(50).next) == ONE" | tee -a $out
   216   echo -e " simp(Iterator.iterate(ONE:Rexp)(r => SEQ(r, ONE | ONE)).drop(50).next) == ONE" | tee -a $out
   217   echo "    ...the Iterator produces the rexp" | tee -a $out
   217   echo -e "    ...the Iterator produces the rexp" | tee -a $out
   218   echo "" | tee -a $out
   218   echo -e "" | tee -a $out
   219   echo "      SEQ(SEQ(SEQ(..., ONE | ONE) , ONE | ONE), ONE | ONE)" | tee -a $out
   219   echo -e "      SEQ(SEQ(SEQ(..., ONE | ONE) , ONE | ONE), ONE | ONE)" | tee -a $out
   220   echo "" | tee -a $out
   220   echo -e "" | tee -a $out
   221   echo "    where SEQ is nested 50 times." | tee -a $out  
   221   echo -e "    where SEQ is nested 50 times." | tee -a $out  
   222   echo "" | tee -a $out
   222   echo -e "" | tee -a $out
   223   echo " simp(Iterator.iterate(ONE:Rexp)(r => ALT(r, r)).drop(20).next) == ONE" | tee -a $out
   223   echo -e " simp(Iterator.iterate(ONE:Rexp)(r => ALT(r, r)).drop(20).next) == ONE" | tee -a $out
   224   echo "    ... the Iterator produces a rexp of size 2097151" | tee -a $out
   224   echo -e "    ... the Iterator produces a rexp of size 2097151" | tee -a $out
   225   echo "" | tee -a $out
   225   echo -e "" | tee -a $out
   226   echo " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" | tee -a $out
   226   echo -e " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" | tee -a $out
   227   echo " matcher(EVIL, \"a\" * 1000000 ++ \"b\") == true" | tee -a $out
   227   echo -e " matcher(EVIL, \"a\" * 1000000 ++ \"b\") == true" | tee -a $out
   228   echo " matcher(EVIL, \"a\" * 1000000) == false" | tee -a $out
   228   echo -e " matcher(EVIL, \"a\" * 1000000) == false" | tee -a $out
   229 
   229 
   230   
   230   
   231   if (time scala_assert_long "re.scala" "re_test6.scala")
   231   if (time scala_assert_long "re.scala" "re_test6.scala")
   232   then
   232   then
   233       echo "  --> success" | tee -a $out
   233       echo -e "  --> success" | tee -a $out
   234       marks=$(( marks + 1 ))
   234       marks=$(( marks + 1 ))
   235   else
   235   else
   236       echo "  --> test failed" | tee -a $out
   236       echo -e "  --> ONE OF THE TESTS FAILED\n" | tee -a $out
   237   fi
   237   fi
   238 fi
   238 fi
   239 
   239 
   240 
   240 
   241 ## final marks
   241 ## final marks
   242 echo "Overall mark for CW 9, Part 1" | tee -a $out
   242 echo -e "Overall mark for CW 9, Core Part" | tee -a $out
   243 echo "$marks" | tee -a $out
   243 echo -e "$marks" | tee -a $out
   244 
   244 
   245 
   245