Log Surgeon
Test & API docs
Loading...
Searching...
No Matches
Query unit tests.

Unit tests for Query construction and interpretation. More...

Functions

void empty_query ()
 Creates and tests an empty Query.
void greedy_wildcard_query ()
 Creates and tests a greedy wildcard Query.
void repeated_greedy_wildcard_query ()
 Creates and tests a query with repeated greedy wildcards.
void mixed_wildcard_query ()
 Creates and tests a query with a non-greedy wildcard followed by a greedy wildcard.
void repeated_non_greedy_wildcard_query ()
 Creates and tests a query with a long non-greedy wildcard sequence.
void escaped_star_query ()
 Creates and tests a query with an escaped '*' character.
void escaped_question_mark_query ()
 Creates and tests a query with an escaped '?' character.
void int_query ()
 Creates and tests a numeric-only query.
void non_wildcard_multi_variable_query ()
 Creates and tests a query with multiple variable types.
void wildcard_multi_variable_query ()
 Creates and tests a query with multiple variable types.

Detailed Description

Unit tests for Query construction and interpretation.

These unit tests contain the Query tag.

Function Documentation

◆ empty_query()

void empty_query ( )

Creates and tests an empty Query.

◆ escaped_question_mark_query()

void escaped_question_mark_query ( )

Creates and tests a query with an escaped '?' character.

◆ escaped_star_query()

void escaped_star_query ( )

Creates and tests a query with an escaped '*' character.

◆ greedy_wildcard_query()

void greedy_wildcard_query ( )

Creates and tests a greedy wildcard Query.

◆ int_query()

void int_query ( )

Creates and tests a numeric-only query.

NOTE: This has a static-text case as strings "1", "2", and "3" in isolation aren't surrounded by delimiters. These tokens then build up the interpretation "123". Although additional interpretations don't impact correctness, they may impact performance. We can optimize these out, but it'll make the code messy. Instead, we should eventually remove the explicit tracking of static-tokens, in favor of only tracking variable tokens.

◆ mixed_wildcard_query()

void mixed_wildcard_query ( )

Creates and tests a query with a non-greedy wildcard followed by a greedy wildcard.

◆ non_wildcard_multi_variable_query()

void non_wildcard_multi_variable_query ( )

Creates and tests a query with multiple variable types.

This test ensures that each non-wildcard token is assigned to the highest priority variable.

NOTE: Similar to the above int_query test there are unneeded interpretations due to aggresively generating static-text tokens.

◆ repeated_greedy_wildcard_query()

void repeated_greedy_wildcard_query ( )

Creates and tests a query with repeated greedy wildcards.

◆ repeated_non_greedy_wildcard_query()

void repeated_non_greedy_wildcard_query ( )

Creates and tests a query with a long non-greedy wildcard sequence.

◆ wildcard_multi_variable_query()

void wildcard_multi_variable_query ( )

Creates and tests a query with multiple variable types.

This test ensures that each greedy wildcard token is identified as all correct token types.

NOTE: Similar to the above int_query test there are unneeded interpretations due to aggresively generating static-text tokens. This same issue causes interpretations with redundant wildcards.