boostorg / boostorg/test

Comparisons of basic_string_views with custom char_traits do not print out the string values

Open
#316 0 comments 0 reactions 1 assignee Claimed by @raffienficiaud View on GitHub
branch
Dominant language
C++
Stars
213
Forks
149
Avg merge
18h 17m
Merged PRs (30d)
2

Description

When I run the following tests
```c++
struct custom_char_traits : std::char_traits {};

BOOST_AUTO_TEST_CASE(custom_char_traits_compare)
{
using sv = std::basic_string_view;
sv sv1 = "sv1";
sv sv2 = "sv2";
BOOST_TEST(sv1 == sv2);
}

BOOST_AUTO_TEST_CASE(std_char_traits_compare)
{
using sv = std::basic_string_view>;
sv sv1 = "sv1";
sv sv2 = "sv2";
BOOST_TEST(sv1 == sv2);
}
```
I get the following output
```
*** 2 failures are detected in the test module "string view comparison"
Running 2 test cases...
example.cpp(14): error: in "custom_char_traits_compare": check sv1 == sv2 has failed
example.cpp(22): error: in "std_char_traits_compare": check sv1 == sv2 has failed [sv1 != sv2]
```

The error message for `std_char_traits_compare` contains the string values, but the error for `custom_char_traits_compare` does not.
Boost Test should display the compared strings regardless of what traits they have.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.