| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
export APERTIUM_TRANSFUSE=no |
| 4 |
set -e -u |
| 5 |
|
| 6 |
cd "$(dirname "$0")" |
| 7 |
|
| 8 |
declare -a input expected |
| 9 |
|
| 10 |
input[0]='a "Hello, World" app |
| 11 |
<code>update"</code> |
| 12 |
<img src="hi"/>NULL> |
| 13 |
<script>a=">";</script> |
| 14 |
<img other="1" alt="ONE"> |
| 15 |
<img other="1"> |
| 16 |
<img alt="TWO" other="x"/> |
| 17 |
<a href="hi">EINS<br/>ZWEI |
| 18 |
<img/>DREI 𝜊 |
| 19 |
<img alt="THREE">FIER |
| 20 |
<img alt="FOUR"/>' |
| 21 |
expected[0]='a "Hello, World" app[ |
| 22 |
<code>]update"[<\/code> |
| 23 |
<img src="hi"\/>]NULL[> |
| 24 |
<script>a=">";<\/script> |
| 25 |
<img other="1" alt="]ONE["> |
| 26 |
<img other="1"> |
| 27 |
<img alt="]TWO[" other="x"\/> |
| 28 |
<a href="hi">]EINS[<br\/>]ZWEI[ |
| 29 |
<img\/>]DREI 𝜊[ |
| 30 |
<img alt="]THREE[">]FIER[ |
| 31 |
<img alt="]FOUR.[]["\/> |
| 32 |
]' |
| 33 |
|
| 34 |
|
| 35 |
input[1]='<apertium-notrans>«</apertium-notrans>' |
| 36 |
expected[1]='.[][<apertium-notrans>«<\/apertium-notrans> |
| 37 |
]' |
| 38 |
|
| 39 |
|
| 40 |
for i in "${!input[@]}"; do |
| 41 |
result=$(../../apertium/apertium-deshtml-alt <<< "${input[$i]}") |
| 42 |
diff <(echo "${expected[$i]}") <(echo "${result}") |
| 43 |
done |