_acs-tcl__acs_tcl__util_url_valid_p (private)
_acs-tcl__acs_tcl__util_url_valid_p
Defined in packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- No testcase defined.
Source code: set _aa_export {} set body_count 1 foreach testcase_body {{ # # Valid URLs # foreach url { "http://la.la" "https://la.la" "https://a.a" "http://example.com" "https://example.com" "ftp://example.com" "http://example.com/" "http://example.com/index.html" "HTTP://example.com" "http://example.com/foo/bar/blah" "http://example.com?foo=bar&bar=foo" "http://foo.com/blah_blah" "http://foo.com/blah_blah/" "http://foo.com/blah_blah_(wikipedia)" "http://foo.com/blah_blah_(wikipedia)_(again)" "http://www.example.com/wpstyle/?p=364" "https://www.example.com/foo/?bar=baz&inga=42&quux" "http://✪df.ws/123" "http://userid:password@example.com:8080" "http://userid:password@example.com:8080/" "http://userid@example.com" "http://userid@example.com/" "http://userid@example.com:8080" "http://userid@example.com:8080/" "http://userid:password@example.com" "http://userid:password@example.com/" "http://142.42.1.1/" "http://142.42.1.1:8080/" "http://➡.ws/䨹" "http://⌘.ws" "http://⌘.ws/" "http://foo.com/blah_(wikipedia)#cite-1" "http://foo.com/blah_(wikipedia)_blah#cite-1" "http://foo.com/unicode_(✪)_in_parens" "http://foo.com/(something)?after=parens" "http://☺.damowmow.com/" "http://code.google.com/events/#&product=browser" "http://j.mp" "ftp://foo.bar/baz" "http://foo.bar/?q=Test%20URL-encoded%20stuff" "http://مثال.إختبار" "http://例子.测试" "http://उदाहरण.परीक्षा" "http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com" "http://1337.net" "http://a.b-c.de" "http://223.255.255.254" } { aa_true "Valid web URL $url" [util_url_valid_p "$url"] aa_true "Valid web URL $url (relative allowed)" [util_url_valid_p -relative "$url"] } # # Invalid URLs # foreach url { "xhttp://example.com" "httpx://example.com" "wysiwyg://example.com" "mailto:joe@example.com" "http://" "http://." "http://.." "http://../" "http://?" "http://??" "http://??/" "http://#" "http://##" "http://##/" "http://foo.bar?q=Spaces should be encoded" "http:///a" "rdar://1234" "h://test" "http:// shouldfail.com" ":// should fail" "http://foo.bar/foo(bar)baz quux" "ftps://foo.bar/" "http://.www.foo.bar/" "http://.www.foo.bar./" "la la la" "http:// la.com" {http://$la.com} "http:///la.com" "http://.la.com" "http://?la.com" "http://#la.com" "http://a " "http://a a" } { aa_false "Invalid web URL $url" [util_url_valid_p "$url"] aa_false "Invalid web URL $url (relative allowed)" [util_url_valid_p -relative "$url"] } # # Relative URLs # foreach url { "" "/" "//" "//a" "///a" "///" "?a" "a:h" "./a" "g?y" "g?y/./x" "foo" "#s" "g#s" "g#s/./x" "g?y#s" ";x" "g;x" "g;x?y#s" "." "./" ".." "../" "../g" "../.." "../../" "../../g" "../../g/" "/foo/" "/foo/bar" "/foo/bar/" "/foo/bar/lol.html" "/foo.bar/?q=Test%20URL-encoded%20stuff" "foo.com" "foo.com/bar/lol" "/foo.com/bar/lol" "/مثال.إختبار" "/例子.测试" "/उदाहरण.परीक्षा" "/-.~_!$&'()*+,;=:%40:80%2f::::::@example.com" "foo.bar/?q=Test%20URL-encoded%20stuff" "مثال.إختبار" "例子.测试" "उदाहरण.परीक्षा" "-.~_!$&'()*+,;=:%40:80%2f::::::@example.com" "no-protocol" "/relative" } { aa_false "Invalid web URL $url" [util_url_valid_p "$url"] aa_true "Valid web URL $url (relative allowed)" [util_url_valid_p -relative "$url"] } }} { aa_log "Running testcase body $body_count" set ::__aa_test_indent [info level] set catch_val [catch $testcase_body msg] if {$catch_val != 0 && $catch_val != 2} { aa_log_result "fail" "acs_tcl__util_url_valid_p (body $body_count): Error during execution: $msg, stack trace: \n$::errorInfo" } incr body_count }XQL Not present: Generic, PostgreSQL, Oracle