added special test cases '.', empty string, NULL, unknown TLD

This commit is contained in:
Tim Ruehsen 2014-05-12 14:15:40 +02:00
parent 7d3e2eebb2
commit 61753f43ab
2 changed files with 8 additions and 0 deletions

View File

@ -78,6 +78,10 @@ static void test_psl(void)
{ ".forgot.his.name", 1 }, { ".forgot.his.name", 1 },
{ "whoever.his.name", 0 }, { "whoever.his.name", 0 },
{ "whoever.forgot.his.name", 0 }, { "whoever.forgot.his.name", 0 },
{ ".", 1 }, /* special case */
{ "", 1 }, /* special case */
{ NULL, 1 }, /* special case */
{ "adfhoweirh", 1 }, /* unknown TLD */
}; };
unsigned it; unsigned it;
const psl_ctx_t *psl; const psl_ctx_t *psl;

View File

@ -76,6 +76,10 @@ static void test_psl(void)
{ ".forgot.his.name", 1 }, { ".forgot.his.name", 1 },
{ "whoever.his.name", 0 }, { "whoever.his.name", 0 },
{ "whoever.forgot.his.name", 0 }, { "whoever.forgot.his.name", 0 },
{ ".", 1 }, /* special case */
{ "", 1 }, /* special case */
{ NULL, 1 }, /* special case */
{ "adfhoweirh", 1 }, /* unknown TLD */
}; };
unsigned it; unsigned it;
psl_ctx_t *psl; psl_ctx_t *psl;