main_testing3/re_test.sh
author Christian Urban <christian.urban@kcl.ac.uk>
Fri, 15 Jan 2021 02:47:51 +0000
changeset 385 44383203970f
parent 376 6cc36d0ef79e
child 403 ffce7b61b446
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 {
376
6cc36d0ef79e updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 352
diff changeset
    28
   (egrep '\bvar\b|\breturn\b|\.par\.|\.par |ListBuffer|AtomicInteger|mutable|util.control|new Array' c$out 2> /dev/null 1> /dev/null)
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    29
}
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
# compilation test
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    34
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    35
echo -e "re.scala runs?" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    36
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    37
if (scala_compile re.scala)
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    38
then
352
97bcf8efe4e0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 347
diff changeset
    39
    echo -e "  --> passed" >> $out
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    40
    tsts=$(( 0 ))
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    41
else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    42
    echo -e "  --> SCALA DID NOT RUN RE.SCALA\n" >> $out
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    43
    tsts=$(( 1 )) 
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    44
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    45
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    46
# var, return, ListBuffer test
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    47
#
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
if [ $tsts -eq 0 ]
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    50
then
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    51
    echo -e "re.scala does not contain vars, returns etc?" >> $out
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    52
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    53
    if (scala_vars re.scala)
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    54
    then
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    55
	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
    56
	tsts=$(( 1 ))
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    57
    else
352
97bcf8efe4e0 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 347
diff changeset
    58
	echo -e "  --> passed" >> $out
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    59
	tsts=$(( 0 )) 
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    60
    fi
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
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    63
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    64
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    65
### re tests
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    67
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    68
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    69
  echo -e " nullable(ZERO) == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    70
  echo -e " nullable(ONE) == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    71
  echo -e " nullable(CHAR('a')) == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    72
  echo -e " nullable(ZERO | ONE) == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    73
  echo -e " nullable(ZERO | CHAR('a')) == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    74
  echo -e " nullable(ONE ~  ONE) == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    75
  echo -e " nullable(ONE ~ CHAR('a')) == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    76
  echo -e " nullable(STAR(ZERO)) == true" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    77
  
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    78
  if (scala_assert "re.scala" "re_test1.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    79
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    80
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    81
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    82
    echo -e "  --> \n ONE TEST FAILED\n" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    83
  fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    84
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    85
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    86
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    87
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
    88
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    89
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    90
  echo -e " der('a', ZERO | ONE) == (ZERO | ZERO)" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    91
  echo -e " der('a', (CHAR('a') | ONE) ~ CHAR('a')) ==" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    92
  echo -e "                 ALT((ONE | ZERO) ~ CHAR('a'), ONE)" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    93
  echo -e " der('a', STAR(CHAR('a'))) == (ONE ~ STAR(CHAR('a')))" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    94
  echo -e " der('b', STAR(CHAR('a'))) == (ZERO ~ STAR(CHAR('a')))" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    95
  
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    96
  if (scala_assert "re.scala" "re_test2.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    97
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
    98
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    99
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   100
    echo -e "  --> \n ONE TEST FAILED\n" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   101
  fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   102
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   103
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   104
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   105
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
   106
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   107
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   108
  echo -e " simp(ZERO | ONE) == ONE" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   109
  echo -e " simp(STAR(ZERO | ONE)) == STAR(ZERO | ONE)" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   110
  echo -e " simp(ONE ~ (ONE ~ (ONE ~ CHAR('a')))) == CHAR('a')" >> $out
329
8a34b2ebc8cc updated
Christian Urban <urbanc@in.tum.de>
parents: 315
diff changeset
   111
  echo -e " simp(((ONE ~ ONE) ~ ONE) ~ CHAR('a')) == CHAR('a'))" >> $out
8a34b2ebc8cc updated
Christian Urban <urbanc@in.tum.de>
parents: 315
diff changeset
   112
  echo -e " simp(((ONE | ONE) ~ ONE) ~ CHAR('a')) == CHAR('a'))" >> $out
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   113
  echo -e " simp(ONE ~ (ONE ~ (ONE ~ ZERO))) == ZERO" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   114
  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
   115
  echo -e " simp(CHAR('a') | CHAR('a')) == CHAR('a')" >> $out
329
8a34b2ebc8cc updated
Christian Urban <urbanc@in.tum.de>
parents: 315
diff changeset
   116
  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
   117
  echo -e " simp(ONE | CHAR('a')) == (ONE | CHAR('a'))" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   118
  echo -e " simp(ALT((CHAR('a') | ZERO) ~ ONE," >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   119
  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
   120
  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
   121
  echo -e " simp(ALT(ONE | ONE, ONE | ONE)) == ONE" >> $out
7ea440e1ffbb updated
Christian Urban <urbanc@in.tum.de>
parents: 300
diff changeset
   122
  echo -e " simp(ALT(ZERO | CHAR('a'), CHAR('a') | ZERO)) == CHAR('a')" >> $out
7ea440e1ffbb updated
Christian Urban <urbanc@in.tum.de>
parents: 300
diff changeset
   123
  echo -e " simp(ALT(ONE | CHAR('a'), CHAR('a') | ONE)) == ALT(ONE | CHAR('a'), CHAR('a') | ONE)" >> $out
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   124
  if (scala_assert "re.scala" "re_test3.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   125
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   126
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   127
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   128
    echo -e "  --> \n ONE TEST FAILED\n" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   129
  fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   130
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   131
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   132
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
   133
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   134
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   135
  echo -e " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   136
  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
   137
  echo -e " ders(List('b'), EVIL) == ONE" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   138
  echo -e " ders(\"bb\".toList, EVIL) == ZERO" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   139
  echo -e " matcher(EVIL, \"a\" * 5 ++ \"b\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   140
  echo -e " matcher(EVIL, \"b\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   141
  echo -e " matcher(EVIL, \"bb\") == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   142
  echo -e " matcher(\"abc\", \"abc\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   143
  echo -e " matcher((\"ab\" | \"a\") ~ (ONE | \"bc\"), \"abc\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   144
  echo -e " matcher(ONE, \"\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   145
  echo -e " matcher(ZERO, \"\") == false" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   146
  echo -e " matcher(ONE | CHAR('a'), \"\") == true" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   147
  echo -e " matcher(ONE | CHAR('a'), \"a\") == true" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   148
  
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   149
  if (scala_assert "re.scala" "re_test4.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   150
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   151
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   152
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   153
    echo -e "  --> \n ONE TEST FAILED\n" >> $out  
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   154
  fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   155
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   156
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   157
347
4de31fdc0d67 updated
Christian Urban <christian.urban@kcl.ac.uk>
parents: 329
diff changeset
   158
if [ $tsts -eq 0 ]
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   159
then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   160
  echo -e " val EVIL = SEQ(STAR(STAR(CHAR('a'))), CHAR('b'))" >> $out  
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   161
  echo -e " size(der('a', der('a', EVIL))) == 28" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   162
  echo -e " size(der('a', der('a', der('a', EVIL)))) == 58" >> $out
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   163
  echo -e " size(ders(\"aaaaaa\".toList, EVIL)) == 8" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   164
  
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   165
  if (scala_assert "re.scala" "re_test5.scala")
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   166
  then
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   167
    echo -e "  --> success" >> $out
153
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   168
  else
221
9e7897f25e13 updated
Christian Urban <urbanc@in.tum.de>
parents: 215
diff changeset
   169
    echo -e "  --> \n ONE TEST FAILED\n" >> $out   
153
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
fi
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   172
4383809c176a updated
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
   173