File tree Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Expand file tree Collapse file tree 1 file changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -721,7 +721,35 @@ function test_timefmt(){
721721}
722722
723723function 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
727755function test_xlsx2csv(){
You can’t perform that action at this time.
0 commit comments