aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp')
-rw-r--r--tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp b/tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp
index 157d0f2a62..e51cca9be4 100644
--- a/tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp
+++ b/tests/auto/qml/qv4identifiertable/tst_qv4identifiertable.cpp
@@ -43,6 +43,7 @@ private slots:
void dontSweepAcrossBucketBoundaries();
void sweepAcrossBucketBoundariesIfFirstBucketFull();
void sweepBucketGap();
+ void insertNumericStringPopulatesIdentifier();
};
void tst_qv4identifiertable::sweepFirstEntryInBucket()
@@ -359,6 +360,17 @@ void tst_qv4identifiertable::sweepBucketGap()
QCOMPARE(table.entriesByHash[3], nullptr);
}
+void tst_qv4identifiertable::insertNumericStringPopulatesIdentifier()
+{
+ QV4::ExecutionEngine engine;
+ const QString numeric = QStringLiteral("1");
+ uint subtype;
+ const uint hash = QV4::String::createHashValue(numeric.constData(), numeric.length(), &subtype);
+ QCOMPARE(subtype, QV4::Heap::String::StringType_ArrayIndex);
+ QCOMPARE(engine.identifierTable->insertString(numeric)->identifier,
+ QV4::PropertyKey::fromArrayIndex(hash));
+}
+
QTEST_MAIN(tst_qv4identifiertable)
#include "tst_qv4identifiertable.moc"