summaryrefslogtreecommitdiffstats
path: root/util/t/uriparse/parse-retard-uri
blob: 0c14914806dde6c3e096cbc99aba3ceda2f00d8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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" == "/'''" ]