micro-test-plus 3.2.0
µTest++, a lightweight testing framework for embedded platforms
Loading...
Searching...
No Matches
String operators

Overloaded operators to compare strings. More...

Functions

constexpr auto micro_os_plus::micro_test_plus::operators::operator!= (std::string_view lhs, std::string_view rhs)
 Non-equality operator for string_view objects.
 
constexpr auto micro_os_plus::micro_test_plus::operators::operator== (std::string_view lhs, std::string_view rhs)
 Equality operator for string_view objects.
 

Detailed Description

Overloaded operators to compare strings.

In addition to the generic operators, there are also equality operators for string_view objects.

Examples
#include <string_view>
using namespace std::literals; // For the "sv" literal.
// ...
mt::test_case ("Operators", [] {
using namespace micro_test_plus::operators;
mt::expect (std::string_view{ compute_ultimate_answer () } == "forty-two"sv)
<< "ultimate answer == 'forty-two'";
});

Function Documentation

◆ operator!=()

constexpr auto micro_os_plus::micro_test_plus::operators::operator!= ( std::string_view lhs,
std::string_view rhs )
constexpr

Non-equality operator for string_view objects.

Definition at line 517 of file micro-test-plus.h.

◆ operator==()

constexpr auto micro_os_plus::micro_test_plus::operators::operator== ( std::string_view lhs,
std::string_view rhs )
constexpr

Equality operator for string_view objects.

Definition at line 507 of file micro-test-plus.h.