summaryrefslogtreecommitdiffstats
path: root/tests/auto/qxmlquery/tst_qxmlquery.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qxmlquery/tst_qxmlquery.cpp')
-rw-r--r--tests/auto/qxmlquery/tst_qxmlquery.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/qxmlquery/tst_qxmlquery.cpp b/tests/auto/qxmlquery/tst_qxmlquery.cpp
index fe9efaea8..5c1432935 100644
--- a/tests/auto/qxmlquery/tst_qxmlquery.cpp
+++ b/tests/auto/qxmlquery/tst_qxmlquery.cpp
@@ -222,6 +222,7 @@ private Q_SLOTS:
void bindVariableQXmlNameQXmlQuerySignature() const;
void bindVariableQXmlNameQXmlQuery() const;
void bindVariableQXmlQueryInvalidate() const;
+ void unknownSourceLocation() const;
void identityConstraintSuccess() const;
void identityConstraintFailure() const;
@@ -3281,6 +3282,23 @@ void tst_QXmlQuery::bindVariableQXmlQueryInvalidate() const
QVERIFY(!query.isValid());
}
+void tst_QXmlQuery::unknownSourceLocation() const
+{
+ QBuffer b;
+ b.setData("<a><b/><b/></a>");
+ b.open(QIODevice::ReadOnly);
+
+ MessageSilencer silencer;
+ QXmlQuery query;
+ query.bindVariable(QLatin1String("inputDocument"), &b);
+ query.setMessageHandler(&silencer);
+
+ query.setQuery(QLatin1String("doc($inputDocument)/a/(let $v := b/string() return if ($v) then $v else ())"));
+
+ QString output;
+ query.evaluateTo(&output);
+}
+
void tst_QXmlQuery::identityConstraintSuccess() const
{
QXmlQuery::QueryLanguage queryLanguage = QXmlQuery::XmlSchema11IdentityConstraintSelector;