mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-06 17:20:22 +00:00

This kind of stuff should have unit tests, even if it's just to show what we expect to match successfully.
14 lines
600 B
C
14 lines
600 B
C
#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"));
|
|
}
|