summaryrefslogtreecommitdiffstats
path: root/util/t
diff options
context:
space:
mode:
Diffstat (limited to 'util/t')
-rwxr-xr-xutil/t/anonbox.net/got-some-valid-looking-email16
-rwxr-xr-xutil/t/dic/can-scrape6
-rwxr-xr-xutil/t/naturalvoices/att-produces-output10
-rw-r--r--util/t/stt/stt-works-with-espeak10
-rwxr-xr-xutil/t/uriparse/parse-retard-uri13
-rwxr-xr-xutil/t/uriparse/parse-url13
6 files changed, 68 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..e254687d
--- /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/[^/][^/]*/$"
+}
diff --git a/util/t/dic/can-scrape b/util/t/dic/can-scrape
new file mode 100755
index 00000000..702c2a02
--- /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/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/stt/stt-works-with-espeak b/util/t/stt/stt-works-with-espeak
new file mode 100644
index 00000000..31710974
--- /dev/null
+++ b/util/t/stt/stt-works-with-espeak
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+cd $(dirname $(readlink -f $0))
+. ../../lib/stt/google.sh
+tmp=$(mktemp)
+test_str="hello"
+trap "rm $tmp" TERM INT EXIT HUP
+espeak --stdout "$test_str" | flac --totally-silent -f -o "$tmp" -
+
+stt "$tmp" | egrep "^$test_str\$" >/dev/null
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" ]
+
+