Index: openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl,v diff -u -r1.20 -r1.21 --- openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 12 Jan 2004 16:00:43 -0000 1.20 +++ openacs-4/packages/acs-tcl/tcl/test/acs-tcl-test-procs.tcl 28 Jan 2004 17:44:53 -0000 1.21 @@ -742,3 +742,29 @@ set randomized_list [util::randomize_list $org_list] aa_true "Long random list" [util_sets_equal_p $org_list $randomized_list] } + +aa_register_case acs_tcl__util_url_valid_p { + A very rudimentary test of util_url_valid_p +} { + foreach url { + "http://example.com" + "https://example.com" + "ftp://example.com" + "http://example.com/" + "HTTP://example.com" + "http://example.com/foo/bar/blah" + "http://example.com?foo=bar&bar=foo" + } { + aa_true "Valid web URL $url" [util_url_valid_p "$url"] + } + foreach url { + "xhttp://example.com" + "httpx://example.com" + "wysiwyg://example.com" + "mailto:joe@example.com" + "foo" + "/foo/bar" + } { + aa_false "Invalid web URL $url" [util_url_valid_p "$url"] + } +}