diff options
author | Russell Belfer <rb@github.com> | 2014-05-12 10:15:30 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-05-12 10:15:30 -0700 |
commit | 7bcced44b7e5536ab1a92ad37735566e855531d0 (patch) | |
tree | d1d070320782fe30ea7d73c7eaf40cfca5efd697 /tests | |
parent | d2c4d1c63d9d5456fcf2cdcd578073d9e7dadc2a (diff) | |
parent | 783555d8e11516fdc01b66da0f873f5854b9bff6 (diff) | |
download | libgit2-7bcced44b7e5536ab1a92ad37735566e855531d0.tar.gz |
Merge pull request #2300 from libgit2/cmn/match-host-tests
Some improvements to the cert checking
Diffstat (limited to 'tests')
-rw-r--r-- | tests/network/matchhost.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/network/matchhost.c b/tests/network/matchhost.c new file mode 100644 index 000000000..3100dc21d --- /dev/null +++ b/tests/network/matchhost.c @@ -0,0 +1,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")); +} |