diff options
Diffstat (limited to 'src/mongo/db/matcher/expression_leaf_test.cpp')
-rw-r--r-- | src/mongo/db/matcher/expression_leaf_test.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/matcher/expression_leaf_test.cpp b/src/mongo/db/matcher/expression_leaf_test.cpp index 46d46c96867..40f50115c84 100644 --- a/src/mongo/db/matcher/expression_leaf_test.cpp +++ b/src/mongo/db/matcher/expression_leaf_test.cpp @@ -1135,22 +1135,22 @@ TEST(RegexMatchExpression, Equality1) { TEST(RegexMatchExpression, RegexCannotContainEmbeddedNullByte) { RegexMatchExpression regex; { - StringData embeddedNull("a\0b", StringData::LiteralTag()); + const auto embeddedNull = "a\0b"_sd; ASSERT_NOT_OK(regex.init("path", embeddedNull, "")); } { - StringData singleNullByte("\0", StringData::LiteralTag()); + const auto singleNullByte = "\0"_sd; ASSERT_NOT_OK(regex.init("path", singleNullByte, "")); } { - StringData leadingNullByte("\0bbbb", StringData::LiteralTag()); + const auto leadingNullByte = "\0bbbb"_sd; ASSERT_NOT_OK(regex.init("path", leadingNullByte, "")); } { - StringData trailingNullByte("bbbb\0", StringData::LiteralTag()); + const auto trailingNullByte = "bbbb\0"_sd; ASSERT_NOT_OK(regex.init("path", trailingNullByte, "")); } } @@ -1158,22 +1158,22 @@ TEST(RegexMatchExpression, RegexCannotContainEmbeddedNullByte) { TEST(RegexMatchExpression, RegexOptionsStringCannotContainEmbeddedNullByte) { RegexMatchExpression regex; { - StringData embeddedNull("a\0b", StringData::LiteralTag()); + const auto embeddedNull = "a\0b"_sd; ASSERT_NOT_OK(regex.init("path", "pattern", embeddedNull)); } { - StringData singleNullByte("\0", StringData::LiteralTag()); + const auto singleNullByte = "\0"_sd; ASSERT_NOT_OK(regex.init("path", "pattern", singleNullByte)); } { - StringData leadingNullByte("\0bbbb", StringData::LiteralTag()); + const auto leadingNullByte = "\0bbbb"_sd; ASSERT_NOT_OK(regex.init("path", "pattern", leadingNullByte)); } { - StringData trailingNullByte("bbbb\0", StringData::LiteralTag()); + const auto trailingNullByte = "bbbb\0"_sd; ASSERT_NOT_OK(regex.init("path", "pattern", trailingNullByte)); } } |