diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2024-02-01 15:04:10 -0700 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2024-02-02 20:14:45 -0700 |
commit | 9fa471b72d8ac7fb1f5b2020463dac2340e1a963 (patch) | |
tree | d3c0d4979d3924ed9f51b55ddd606955915a6077 /tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp | |
parent | bffddc6a993c4b6b64922e8d327bdf32e0d4975a (diff) |
Fix frontMatter tests: fixed fonts and testdata
When the main font is a fixed-width font, QTextMarkdownWriter generates
backticks around plain text; so QEXPECT_FAIL if we detect that.
tst_QTextMarkdownWriter::frontMatter() Compared values are not the same
Actual (output) : "---\nfoo\n---\n`bar`\n\n"
Expected ("---\nfoo\n---\nbar\n\n")
Also, include all test data as resources for platforms that need it
(such as Android).
Task-number: QTBUG-103484
Change-Id: If18ca493c402b128cdc0fb1910b2e822512af6e8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp')
-rw-r--r-- | tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp index 71c4588a6a..ab913cf41f 100644 --- a/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp +++ b/tests/auto/gui/text/qtextmarkdownwriter/tst_qtextmarkdownwriter.cpp @@ -533,7 +533,10 @@ void tst_QTextMarkdownWriter::frontMatter() document->setMetaInformation(QTextDocument::FrontMatter, "foo"); const QString output = documentToUnixMarkdown(); - QCOMPARE(output, "---\nfoo\n---\nbar\n\n"); + const QString expectedOutput("---\nfoo\n---\nbar\n\n"); + if (output != expectedOutput && isMainFontFixed()) + QEXPECT_FAIL("", "fixed-pitch main font (QTBUG-103484)", Continue); + QCOMPARE(output, expectedOutput); } void tst_QTextMarkdownWriter::rewriteDocument_data() |