Commit 3df17628 authored by Chad Austin's avatar Chad Austin Committed by Facebook Github Bot

test that _sp includes nul bytes

Summary:
D6617812 wants to build a StringPiece from a literal with an
embedded nul. Add a test to verify that _sp is suitable for this use
case.

Reviewed By: yfeldblum

Differential Revision: D6651024

fbshipit-source-id: be4fb875762829fdb61c57fa72954fef286e9df0
parent 5eda6650
...@@ -1428,3 +1428,8 @@ TEST(Range, LiteralSuffix) { ...@@ -1428,3 +1428,8 @@ TEST(Range, LiteralSuffix) {
constexpr Range<wchar_t const*> pieceW{L"hello", 5}; constexpr Range<wchar_t const*> pieceW{L"hello", 5};
EXPECT_EQ(literalPieceW, pieceW); EXPECT_EQ(literalPieceW, pieceW);
} }
TEST(Range, LiteralSuffixContainsNulBytes) {
constexpr auto literalPiece = "\0foo\0"_sp;
EXPECT_EQ(5u, literalPiece.size());
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment