Skip to content

Commit b2bcb95

Browse files
committed
Quick Save
1 parent 3327644 commit b2bcb95

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

test_cmds.bash

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,35 @@ function test_timefmt(){
721721
}
722722

723723
function test_urlparse(){
724-
echo "test_urlparse skipping, not implemented";
724+
EXPECTED='http example.com /my/page.html'
725+
RESULT=$(urlparse http://example.com/my/page.html)
726+
assert_equal "test_urlparse (1)" "$EXPECTED" "$RESULT"
727+
728+
EXPECTED='http'
729+
RESULT="$(urlparse -protocol http://example.com/my/page.html)"
730+
assert_equal "test_urlparse (2)" "$EXPECTED" "$RESULT"
731+
732+
EXPECTED='example.com'
733+
RESULT="$(urlparse -host http://example.com/my/page.html)"
734+
assert_equal "test_urlparse (3)" "$EXPECTED" "$RESULT"
735+
736+
EXPECTED='/my/page.html'
737+
RESULT="$(urlparse -path http://example.com/my/page.html)"
738+
assert_equal "test_urlparse (4)" "$EXPECTED" "$RESULT"
739+
740+
EXPECTED='/my'
741+
RESULT="$(urlparse -dirname http://example.com/my/page.html)"
742+
assert_equal "test_urlparse (5)" "$EXPECTED" "$RESULT"
743+
744+
EXPECTED='page.html'
745+
RESULT="$(urlparse -basename http://example.com/my/page.html)"
746+
assert_equal "test_urlparse (6)" "$EXPECTED" "$RESULT"
747+
748+
EXPECTED='.html'
749+
RESULT="$(urlparse -extname http://example.com/my/page.html)"
750+
assert_equal "test_urlparse (7)" "$EXPECTED" "$RESULT"
751+
752+
echo "test_urlparse OK";
725753
}
726754

727755
function test_xlsx2csv(){

0 commit comments

Comments
 (0)