mirror of
https://github.com/ivabus/pantry
synced 2024-11-29 11:45:07 +03:00
2281d05cba
new file: projects/rockdaboot.github.io/libpsl/test.c
20 lines
No EOL
452 B
C
20 lines
No EOL
452 B
C
#include <assert.h>
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
#include <libpsl.h>
|
|
|
|
int main(void)
|
|
{
|
|
const psl_ctx_t *psl = psl_builtin();
|
|
|
|
const char *domain = ".eu";
|
|
assert(psl_is_public_suffix(psl, domain));
|
|
|
|
const char *host = "www.example.com";
|
|
const char *expected_domain = "example.com";
|
|
const char *actual_domain = psl_registrable_domain(psl, host);
|
|
assert(strcmp(actual_domain, expected_domain) == 0);
|
|
|
|
return 0;
|
|
} |