Branch data Line data Source code
1 : : /* SPDX-License-Identifier: LGPL-2.1+ */ 2 : : 3 : : #include "macro.h" 4 : : #include "web-util.h" 5 : : 6 : 4 : static void test_is_valid_documentation_url(void) { 7 [ - + ]: 4 : assert_se(documentation_url_is_valid("http://www.freedesktop.org/wiki/Software/systemd")); 8 [ - + ]: 4 : assert_se(documentation_url_is_valid("https://www.kernel.org/doc/Documentation/binfmt_misc.txt")); /* dead */ 9 [ - + ]: 4 : assert_se(documentation_url_is_valid("https://www.kernel.org/doc/Documentation/admin-guide/binfmt-misc.rst")); 10 [ - + ]: 4 : assert_se(documentation_url_is_valid("https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.html")); 11 [ - + ]: 4 : assert_se(documentation_url_is_valid("file:/foo/foo")); 12 [ - + ]: 4 : assert_se(documentation_url_is_valid("man:systemd.special(7)")); 13 [ - + ]: 4 : assert_se(documentation_url_is_valid("info:bar")); 14 : : 15 [ - + ]: 4 : assert_se(!documentation_url_is_valid("foo:")); 16 [ - + ]: 4 : assert_se(!documentation_url_is_valid("info:")); 17 [ - + ]: 4 : assert_se(!documentation_url_is_valid("")); 18 : 4 : } 19 : : 20 : 4 : int main(int argc, char *argv[]) { 21 : 4 : test_is_valid_documentation_url(); 22 : : 23 : 4 : return 0; 24 : : }