Comparisons of basic_string_views with custom char_traits do not print out the string values
@raffienficiaud is already working on this.
Since Feb 27, 2022.
Assessment
This issue has not been assessed yet.
Description
When I run the following tests
struct custom_char_traits : std::char_traits<char> {};
BOOST_AUTO_TEST_CASE(custom_char_traits_compare)
{
using sv = std::basic_string_view<char, custom_char_traits>;
sv sv1 = "sv1";
sv sv2 = "sv2";
BOOST_TEST(sv1 == sv2);
}
BOOST_AUTO_TEST_CASE(std_char_traits_compare)
{
using sv = std::basic_string_view<char, std::char_traits<char>>;
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.
- Dominant language
- C++
- Stars
- 213
- Forks
- 149
- Avg merge
- 18h 17m
- Merged PRs (30d)
- 2
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/test
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
-
Conversion Warning with GCC15 when using operator<< within custom failure message and -WConversion Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
AXERA-TECH/ax-llm#77 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
games-on-whales/wolf#509 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
bug-unconfirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-samples#453 ·