summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Davenport <qball@gmpclient.org>2017-02-17 09:58:47 +0100
committerDave Davenport <qball@gmpclient.org>2017-02-17 09:58:47 +0100
commitf7b4bebb9b6188c5eee3d7e76c89f5b6d574f98d (patch)
tree5d62f51671d6c17b3e6a71692b5580ae48ffc5c2 /test
parent2ef45c46a8fc3135dfb2286734ed64a740d27793 (diff)
Rename token_match to helper_token_match.
Diffstat (limited to 'test')
-rw-r--r--test/helper-tokenize.c248
1 files changed, 124 insertions, 124 deletions
diff --git a/test/helper-tokenize.c b/test/helper-tokenize.c
index dcfe6985..c5c6bafa 100644
--- a/test/helper-tokenize.c
+++ b/test/helper-tokenize.c
@@ -50,204 +50,204 @@ int main ( int argc, char ** argv )
config.matching_method = MM_NORMAL;
GRegex **tokens = tokenize ( "noot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap Noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "Nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "noOTap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap Noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "Nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "noOTap mies") == TRUE );
tokenize_free ( tokens );
tokens = tokenize ( "noot", TRUE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap Noot mies") == FALSE );
- TASSERT ( token_match ( tokens, "Nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "noOTap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap Noot mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "Nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "noOTap mies") == FALSE );
tokenize_free ( tokens );
tokens = tokenize ( "no ot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == TRUE );
tokenize_free ( tokens );
}
{
config.matching_method = MM_GLOB;
GRegex **tokens = tokenize ( "noot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap Noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "Nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "noOTap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap Noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "Nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "noOTap mies") == TRUE );
tokenize_free ( tokens );
tokens = tokenize ( "noot", TRUE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap Noot mies") == FALSE );
- TASSERT ( token_match ( tokens, "Nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "noOTap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap Noot mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "Nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "noOTap mies") == FALSE );
tokenize_free ( tokens );
tokens = tokenize ( "no ot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == TRUE );
tokenize_free ( tokens );
tokens = tokenize ( "n?ot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == FALSE);
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == FALSE);
tokenize_free ( tokens );
tokens = tokenize ( "n*ot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == TRUE);
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == TRUE);
tokenize_free ( tokens );
tokens = tokenize ( "n* ot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == TRUE);
- TASSERT ( token_match ( tokens, "ot nap mies") == TRUE);
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == TRUE);
+ TASSERT ( helper_token_match ( tokens, "ot nap mies") == TRUE);
tokenize_free ( tokens );
}
{
config.matching_method = MM_FUZZY;
GRegex **tokens = tokenize ( "noot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap Noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "Nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "noOTap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap Noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "Nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "noOTap mies") == TRUE );
tokenize_free ( tokens );
tokens = tokenize ( "noot", TRUE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap Noot mies") == FALSE );
- TASSERT ( token_match ( tokens, "Nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "noOTap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap Noot mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "Nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "noOTap mies") == FALSE );
tokenize_free ( tokens );
tokens = tokenize ( "no ot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == TRUE );
tokenize_free ( tokens );
tokens = tokenize ( "n ot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == TRUE);
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == TRUE);
tokenize_free ( tokens );
tokens = tokenize ( "ont", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == FALSE);
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap nmiest") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == FALSE);
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap nmiest") == TRUE );
tokenize_free ( tokens );
tokens = tokenize ( "o n t", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == TRUE);
- TASSERT ( token_match ( tokens, "ot nap mies") == TRUE);
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == TRUE);
+ TASSERT ( helper_token_match ( tokens, "ot nap mies") == TRUE);
tokenize_free ( tokens );
}
{
config.matching_method = MM_REGEX;
GRegex **tokens = tokenize ( "noot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap Noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "Nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "noOTap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap Noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "Nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "noOTap mies") == TRUE );
tokenize_free ( tokens );
tokens = tokenize ( "noot", TRUE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap Noot mies") == FALSE );
- TASSERT ( token_match ( tokens, "Nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "noOTap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap Noot mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "Nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "noOTap mies") == FALSE );
tokenize_free ( tokens );
tokens = tokenize ( "no ot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == TRUE );
tokenize_free ( tokens );
tokens = tokenize ( "n.?ot", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noap miesot") == FALSE);
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == FALSE);
tokenize_free ( tokens );
tokens = tokenize ( "n[oa]{2}t", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == TRUE );
- TASSERT ( token_match ( tokens, "aap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == TRUE );
- TASSERT ( token_match ( tokens, "noat miesot") == TRUE);
- TASSERT ( token_match ( tokens, "noaat miesot") == FALSE);
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == TRUE );
+ TASSERT ( helper_token_match ( tokens, "noat miesot") == TRUE);
+ TASSERT ( helper_token_match ( tokens, "noaat miesot") == FALSE);
tokenize_free ( tokens );
tokens = tokenize ( "^(aap|noap)\\sMie.*", FALSE );
- TASSERT ( token_match ( tokens, "aap noot mies") == FALSE );
- TASSERT ( token_match ( tokens, "aap mies") == TRUE);
- TASSERT ( token_match ( tokens, "nooaap mies") == FALSE );
- TASSERT ( token_match ( tokens, "nootap mies") == FALSE );
- TASSERT ( token_match ( tokens, "noap miesot") == TRUE);
- TASSERT ( token_match ( tokens, "ot nap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "aap noot mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "aap mies") == TRUE);
+ TASSERT ( helper_token_match ( tokens, "nooaap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "nootap mies") == FALSE );
+ TASSERT ( helper_token_match ( tokens, "noap miesot") == TRUE);
+ TASSERT ( helper_token_match ( tokens, "ot nap mies") == FALSE );
tokenize_free ( tokens );
}
}