diff options
Diffstat (limited to 'tests/auto/corelib/serialization/qtextstream')
-rw-r--r-- | tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp index df8746e518..edea4713a1 100644 --- a/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp +++ b/tests/auto/corelib/serialization/qtextstream/tst_qtextstream.cpp @@ -161,6 +161,7 @@ private slots: void string_write_operator_ToDevice(); void latin1String_write_operator_ToDevice(); void stringref_write_operator_ToDevice(); + void stringview_write_operator_ToDevice(); // other void skipWhiteSpace_data(); @@ -2573,6 +2574,17 @@ void tst_QTextStream::stringref_write_operator_ToDevice() QCOMPARE(buf.buffer().constData(), "No explicit lengthExplicit length"); } +void tst_QTextStream::stringview_write_operator_ToDevice() +{ + QBuffer buf; + buf.open(QBuffer::WriteOnly); + QTextStream stream(&buf); + const QStringView expected = QStringViewLiteral("expectedStringView"); + stream << expected; + stream.flush(); + QCOMPARE(buf.buffer().constData(), "expectedStringView"); +} + // ------------------------------------------------------------------------------ void tst_QTextStream::useCase1() { |