File: matchhost.c

package info (click to toggle)
libgit2 0.21.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 18,740 kB
  • ctags: 14,057
  • sloc: ansic: 127,946; sh: 191; python: 175; php: 65; makefile: 63
file content (13 lines) | stat: -rw-r--r-- 600 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
#include "clar_libgit2.h"
#include "netops.h"

void test_network_matchhost__match(void)
{
	cl_git_pass(gitno__match_host("*.example.org", "www.example.org"));
	cl_git_pass(gitno__match_host("*.foo.example.org", "www.foo.example.org"));
	cl_git_fail(gitno__match_host("*.foo.example.org", "foo.example.org"));
	cl_git_fail(gitno__match_host("*.foo.example.org", "www.example.org"));
	cl_git_fail(gitno__match_host("*.example.org", "example.org"));
	cl_git_fail(gitno__match_host("*.example.org", "www.foo.example.org"));
	cl_git_fail(gitno__match_host("*.example.org", "blah.www.www.example.org"));
}