summaryrefslogtreecommitdiffstats
path: root/util/t/uriparse/parse-retard-uri
blob: 76feac41331bad5f26c02e32c6ded409949f4807 (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" = "/'''" ]