diff options
Diffstat (limited to 'util/t')
| -rwxr-xr-x | util/t/anonbox.net/got-some-valid-looking-email | 16 | ||||
| -rwxr-xr-x | util/t/dic/can-scrape | 6 | ||||
| -rwxr-xr-x | util/t/mobile.vvs.de/smoke-test | 5 | ||||
| -rwxr-xr-x | util/t/naturalvoices/att-produces-output | 10 | ||||
| -rwxr-xr-x | util/t/uriparse/parse-retard-uri | 13 | ||||
| -rwxr-xr-x | util/t/uriparse/parse-url | 13 | ||||
| -rwxr-xr-x | util/t/vvs.de/smoke-test | 11 |
7 files changed, 74 insertions, 0 deletions
diff --git a/util/t/anonbox.net/got-some-valid-looking-email b/util/t/anonbox.net/got-some-valid-looking-email new file mode 100755 index 00000000..4c3e7a11 --- /dev/null +++ b/util/t/anonbox.net/got-some-valid-looking-email @@ -0,0 +1,16 @@ +#! /bin/sh +set -euf + +tempfile=`mktemp /tmp/test.XXXXXXXX` +trap "rm -f $tempfile" EXIT INT + +anonbox.net >$tempfile +. $tempfile + +{ + echo $email +} | { + IFS=@. read _logname subdomain domain + + echo "$uri" | grep -q "^https://$domain/$subdomain/[0-9a-f]*/$" +} diff --git a/util/t/dic/can-scrape b/util/t/dic/can-scrape new file mode 100755 index 00000000..a31e0f6c --- /dev/null +++ b/util/t/dic/can-scrape @@ -0,0 +1,6 @@ +#! /bin/sh +set -euf + +dic test | + sed 's/\[[^m]*m//g' | + grep -q '^test - der Test$' diff --git a/util/t/mobile.vvs.de/smoke-test b/util/t/mobile.vvs.de/smoke-test new file mode 100755 index 00000000..0b9e7960 --- /dev/null +++ b/util/t/mobile.vvs.de/smoke-test @@ -0,0 +1,5 @@ +#! /bin/sh +set -euf +mobile.vvs.de hauptbahnhof | + sed -n 'p;q' | + grep -q '\[4m[0-9][0-9]:[0-9][0-9] Stuttgart, Hauptbahnhof\[m' diff --git a/util/t/naturalvoices/att-produces-output b/util/t/naturalvoices/att-produces-output new file mode 100755 index 00000000..17b40144 --- /dev/null +++ b/util/t/naturalvoices/att-produces-output @@ -0,0 +1,10 @@ +#!/bin/sh +set -euf + +cd $(dirname $(readlink -f $0)) +. ../../lib/naturalvoices/att.sh + +OUTFILE="`mktemp /tmp/voice.XXXXXXXX`" +trap "rm $OUTFILE" TERM INT EXIT +get_tts 'hallo, welt!' +file $OUTFILE |grep -q WAVE diff --git a/util/t/uriparse/parse-retard-uri b/util/t/uriparse/parse-retard-uri new file mode 100755 index 00000000..76feac41 --- /dev/null +++ b/util/t/uriparse/parse-retard-uri @@ -0,0 +1,13 @@ +#!/bin/sh +set -euf +tempfile="`mktemp /tmp/test.XXXXXXXX`" +trap "/bin/rm -f $tempfile" EXIT INT + +uriparse "http://'lolwut:\"khan@domain.tld/'''" > $tempfile +. $tempfile +[ "$HOSTN" = "domain.tld" ] && \ + [ "$USERNAME" = "'lolwut" ] && \ + [ "$PASSWORD" = '"khan' ] && \ + [ "$URIPATH" = "/'''" ] + + diff --git a/util/t/uriparse/parse-url b/util/t/uriparse/parse-url new file mode 100755 index 00000000..2ccf39c9 --- /dev/null +++ b/util/t/uriparse/parse-url @@ -0,0 +1,13 @@ +#!/bin/sh +set -euf +tempfile="`mktemp /tmp/test.XXXXXXXX`" +trap "/bin/rm -f $tempfile" EXIT INT + +uriparse "http://user:pass@domain.tld/path" > $tempfile +. $tempfile +[ "$HOSTN" = "domain.tld" ] && \ + [ $USERNAME = "user" ] && \ + [ $PASSWORD = "pass" ] && \ + [ $URIPATH = "/path" ] + + diff --git a/util/t/vvs.de/smoke-test b/util/t/vvs.de/smoke-test new file mode 100755 index 00000000..451270fe --- /dev/null +++ b/util/t/vvs.de/smoke-test @@ -0,0 +1,11 @@ +#! /bin/sh +set -euf + +vvs.de Hauptbahnhof Renningen 13 37 | { + read from && test "x$from" = 'xfrom: Hauptbahnhof' + read to && test "x$to" = 'xto: Renningen' + read sep && test "x$sep" = 'x-------------------------------------' + while read line; do + echo "$line" | grep -q '^[0-9][0-9]:[0-9][0-9] [0-9][0-9]:[0-9][0-9] ' + done +} |
