test that _sp includes nul bytes
[folly.git] / folly / test / RangeTest.cpp
index b1298cacec7f659466ce85bdd9f990d169bd9338..42faf4dea14af05817c88cef57316889254ba343 100644 (file)
@@ -1428,3 +1428,8 @@ TEST(Range, LiteralSuffix) {
   constexpr Range<wchar_t const*> pieceW{L"hello", 5};
   EXPECT_EQ(literalPieceW, pieceW);
 }
   constexpr Range<wchar_t const*> pieceW{L"hello", 5};
   EXPECT_EQ(literalPieceW, pieceW);
 }
+
+TEST(Range, LiteralSuffixContainsNulBytes) {
+  constexpr auto literalPiece = "\0foo\0"_sp;
+  EXPECT_EQ(5u, literalPiece.size());
+}