diff --git a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp index 69702a14b3..0185837535 100644 --- a/tests/auto/corelib/text/qstringview/tst_qstringview.cpp +++ b/tests/auto/corelib/text/qstringview/tst_qstringview.cpp @@ -301,6 +301,14 @@ void tst_QStringView::constExpr() const Q_STATIC_ASSERT(sv2.isNull()); Q_STATIC_ASSERT(sv2.empty()); } + { + constexpr QStringView sv = nullptr; + Q_STATIC_ASSERT(sv.size() == 0); + Q_STATIC_ASSERT(sv.isNull()); + Q_STATIC_ASSERT(sv.empty()); + Q_STATIC_ASSERT(sv.isEmpty()); + Q_STATIC_ASSERT(sv.utf16() == nullptr); + } { constexpr QStringView sv = u""; Q_STATIC_ASSERT(sv.size() == 0);