summaryrefslogtreecommitdiffstats
path: root/util/t/uriparse
diff options
context:
space:
mode:
Diffstat (limited to 'util/t/uriparse')
-rwxr-xr-xutil/t/uriparse/parse-retard-uri13
-rwxr-xr-xutil/t/uriparse/parse-url13
2 files changed, 26 insertions, 0 deletions
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" ]
+
+