main_testing3/re_test.sh
author Christian Urban <christian.urban@kcl.ac.uk>
Thu, 03 Nov 2022 11:30:09 +0000
changeset 432 de701b64a4e0
parent 426 b51467741af2
child 433 6af86ba1208f
permissions -rwxr-xr-x
updated
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
#!/bin/bash
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     2
set -euo pipefail
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     3
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
out=${1:-output}
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
     7
echo -e "" > $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
     9
echo -e "Below is the feedback for your submission of re.scala." >> $out
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    10
echo -e "" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    11
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
# compilation tests
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
function scala_compile {
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    16
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -Xprint:parser "$1" 2> c$out 1> c$out)
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
}
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
# functional tests
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
function scala_assert {
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    22
  (ulimit -t 30; JAVA_OPTS="-Xmx1g" scala -i "$1" -- "$2" -e "" 2> /dev/null 1> /dev/null)
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
}
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
# purity test
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    26
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
function scala_vars {
426
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    28
    (sed 's/immutable/ok/g' c$out > cb$out;
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    29
     egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' cb$out 2> /dev/null 1> /dev/null)
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    30
}
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    31
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    34
# compilation test
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    35
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    36
echo -e "re.scala runs?" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    37
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    38
if (scala_compile re.scala)
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    39
then
352
97bcf8efe4e0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 347
diff changeset
    40
    echo -e "  --> passed" >> $out
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    41
    tsts=$(( 0 ))
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    42
else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    43
    echo -e "  --> SCALA DID NOT RUN RE.SCALA\n" >> $out
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    44
    tsts=$(( 1 )) 
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    46
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    47
# var, return, ListBuffer test
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    48
#
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    49
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    50
if [ $tsts -eq 0 ]
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    51
then
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    52
    echo -e "re.scala does not contain vars, returns etc?" >> $out
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    53
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    54
    if (scala_vars re.scala)
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    55
    then
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    56
	echo -e "   --> FAIL (make triple-sure your program conforms to the required format)" >> $out 
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    57
	tsts=$(( 1 ))
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    58
    else
352
97bcf8efe4e0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 347
diff changeset
    59
	echo -e "  --> passed" >> $out
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    60
	tsts=$(( 0 )) 
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    61
    fi
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    62
fi
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    63
426
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    64
### make sure datatypes are not tampered with
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    65
426
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    66
if [ $tsts -eq 0 ]
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    67
then
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    68
    echo -e "re.scala has case classes for ALTs and SEQs?" >> $out
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    69
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    70
    if (scala_assert "re.scala" "re_test0.scala")
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    71
    then
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    72
	echo -e "  --> passed" >> $out
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    73
	tsts=$(( 0 ))
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    74
    else	
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    75
	echo -e "  --> FAIL (make sure the case clases are as given in the template)" >> $out 
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    76
	tsts=$(( 1 ))
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    77
    fi
b51467741af2 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 424
diff changeset
    78
fi
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    79
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    80
### re tests
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    82
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    84
  echo -e " nullable(ZERO) == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    85
  echo -e " nullable(ONE) == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    86
  echo -e " nullable(CHAR('a')) == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    87
  echo -e " nullable(ZERO | ONE) == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    88
  echo -e " nullable(ZERO | CHAR('a')) == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    89
  echo -e " nullable(ONE ~  ONE) == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    90
  echo -e " nullable(ONE ~ CHAR('a')) == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    91
  echo -e " nullable(STAR(ZERO)) == true" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    92
  
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    93
  if (scala_assert "re.scala" "re_test1.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    94
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    95
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    96
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    97
    echo -e "  --> \n ONE TEST FAILED\n" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    98
  fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   100
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
   103
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   105
  echo -e " der('a', ZERO | ONE) == (ZERO | ZERO)" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   106
  echo -e " der('a', (CHAR('a') | ONE) ~ CHAR('a')) ==" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   107
  echo -e "                 ALT((ONE | ZERO) ~ CHAR('a'), ONE)" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   108
  echo -e " der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a')))" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   109
  echo -e " der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a')))" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   110
  
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   111
  if (scala_assert "re.scala" "re_test2.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   112
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   113
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   114
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   115
    echo -e "  --> \n ONE TEST FAILED\n" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   116
  fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   117
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   118
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   119
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   120
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
   121
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   122
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   123
  echo -e " simp(ZERO | ONE) == ONE" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   124
  echo -e " simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE)" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   125
  echo -e " simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a')" >> $out
424
Christian Urban <christian.urban@kcl.ac.uk>
parents: 403
diff changeset
   126
  echo -e " simp(((ONE ~ ONE) ~ ONE) ~ CHAR('a')) == CHAR('a')" >> $out
Christian Urban <christian.urban@kcl.ac.uk>
parents: 403
diff changeset
   127
  echo -e " simp(((ONE | ONE) ~ ONE) ~ CHAR('a')) == CHAR('a')" >> $out
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   128
  echo -e " simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   129
  echo -e " simp(ALT(ONE ~ (ONE ~ (ONE ~ ZERO)), CHAR('a'))) == CHAR('a')" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   130
  echo -e " simp(CHAR('a') | CHAR('a')) == CHAR('a')" >> $out
329
8a34b2ebc8cc updated
Christian Urban <urbanc@in.tum.de>
parents: 315
diff changeset
   131
  echo -e " simp(CHAR('a') ~ CHAR('a')) == CHAR('a') ~ CHAR('a')" >> $out
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   132
  echo -e " simp(ONE | CHAR('a')) == (ONE | CHAR('a'))" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   133
  echo -e " simp(ALT((CHAR('a') | ZERO) ~ ONE," >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   134
  echo -e "          ((ONE | CHAR('b')) | CHAR('c')) ~ (CHAR('d') ~ ZERO))) == CHAR('a')" >> $out
315
7ea440e1ffbb updated
Christian Urban <urbanc@in.tum.de>
parents: 300
diff changeset
   135
  echo -e " simp((ZERO | ((ZERO | ZERO) | (ZERO | ZERO))) ~ ((ONE | ZERO) | ONE ) ~ (CHAR('a'))) == ZERO" >> $out
7ea440e1ffbb updated
Christian Urban <urbanc@in.tum.de>
parents: 300
diff changeset
   136
  echo -e " simp(ALT(ONE | ONE, ONE | ONE)) == ONE" >> $out
7ea440e1ffbb updated
Christian Urban <urbanc@in.tum.de>
parents: 300
diff changeset
   137
  echo -e " simp(ALT(ZERO | CHAR('a'), CHAR('a') | ZERO)) == CHAR('a')" >> $out
403
ffce7b61b446 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 376
diff changeset
   138
  echo -e " simp(ALT(ONE | CHAR('a'), CHAR('a') | ONE)) == ALT(ONE, CHAR('a'))" >> $out
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   139
  if (scala_assert "re.scala" "re_test3.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   140
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   141
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   142
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   143
    echo -e "  --> \n ONE TEST FAILED\n" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   144
  fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   145
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   146
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   147
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
   148
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   149
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   150
  echo -e " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   151
  echo -e " ders(\"aaaaa\".toList, EVIL) == SEQ(SEQ(STAR(CHAR('a')),STAR(STAR(CHAR('a')))),CHAR('b'))" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   152
  echo -e " ders(List('b'), EVIL) == ONE" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   153
  echo -e " ders(\"bb\".toList, EVIL) == ZERO" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   154
  echo -e " matcher(EVIL, \"a\" * 5 ++ \"b\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   155
  echo -e " matcher(EVIL, \"b\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   156
  echo -e " matcher(EVIL, \"bb\") == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   157
  echo -e " matcher(\"abc\", \"abc\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   158
  echo -e " matcher((\"ab\" | \"a\") ~ (ONE | \"bc\"), \"abc\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   159
  echo -e " matcher(ONE, \"\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   160
  echo -e " matcher(ZERO, \"\") == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   161
  echo -e " matcher(ONE | CHAR('a'), \"\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   162
  echo -e " matcher(ONE | CHAR('a'), \"a\") == true" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   163
  
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   164
  if (scala_assert "re.scala" "re_test4.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   165
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   166
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   167
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   168
    echo -e "  --> \n ONE TEST FAILED\n" >> $out  
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   169
  fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   170
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   171
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
   173
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   174
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   175
  echo -e " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" >> $out  
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   176
  echo -e " size(der('a', der('a', EVIL))) == 28" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   177
  echo -e " size(der('a', der('a', der('a', EVIL)))) == 58" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   178
  echo -e " size(ders(\"aaaaaa\".toList, EVIL)) == 8" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   179
  
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   180
  if (scala_assert "re.scala" "re_test5.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   181
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   182
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   183
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   184
    echo -e "  --> \n ONE TEST FAILED\n" >> $out   
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   185
  fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   186
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   187
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   188