Log Surgeon
Test & API docs
Loading...
Searching...
No Matches
test-query-interpretation.cpp File Reference
#include <cstdint>
#include <string_view>
#include <vector>
#include <log_surgeon/wildcard_query_parser/QueryInterpretation.hpp>
#include <catch2/catch_test_macros.hpp>
#include "comparison_test_utils.hpp"

Functions

void empty_query_interpretation ()
 Creates an empty QueryInterpretation and tests serialization.
void static_text_query_interpretation ()
 Creates a QueryInterpretation with only static-text and tests serialization.
void variable_query_interpretation ()
 Creates a QueryInterpretation with a variable and tests serialization.
void wildcard_variable_query_interpretation ()
 Creates a QueryInterpretation with a wildcard variable and tests serialization.
void append_empty_static_text ()
 Appends empty static-text to a QueryInterpretation and tests serialization.
void append_empty_variable ()
 Appends an empty variable to a QueryInterpretation and tests serialization.
void append_empty_query_interpretation ()
 Appends an empty QueryInterpretation to another and tests serialization.
void append_tokens ()
 Appends a sequence of static and variable tokens and tests serialization.
void append_canonicalization ()
 Tests whether adjacent static-text tokens are merged for canonicalization.
void append_query_interpretation ()
 Appends a QueryInterpretation to another and tests serialization and canonicalization.
void comparison_operators ()
 Tests operator==, operator<=>, and all derived operators.
template<StronglyThreeWayComparable T>
auto pairwise_comparison_of_strictly_ascending_vector (std::vector< T > const &ordered_vector) -> void
template<StronglyThreeWayComparable T>
auto test_equal (T const &lhs, T const &rhs) -> void

Function Documentation

◆ pairwise_comparison_of_strictly_ascending_vector()

template<StronglyThreeWayComparable T>
auto log_surgeon::tests::pairwise_comparison_of_strictly_ascending_vector ( std::vector< T > const & ordered_vector) -> void

Tests operators <=>, ==, !=, <, <=, >, >= for every pair of elements in the vector.

Parameters
ordered_vectorVector where elements are ordered to be strictly ascending.

◆ test_equal()

template<StronglyThreeWayComparable T>
auto log_surgeon::tests::test_equal ( T const & lhs,
T const & rhs ) -> void

Tests comparison operators when lhs == rhs.

Parameters
lhsValue on the lhs of the operator.
rhsValue on the rhs of the operator.