diff options
Diffstat (limited to 'tests/auto/qml/qqmlecmascript')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index aaaaf09925..f849403cd8 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -362,6 +362,7 @@ private slots: void hugeObject(); void templateStringTerminator(); void arrayAndException(); + void numberToStringWithRadix(); private: // static void propertyVarWeakRefCallback(v8::Persistent<v8::Value> object, void* parameter); @@ -8878,6 +8879,21 @@ void tst_qqmlecmascript::arrayAndException() QVERIFY(value.isError()); } +void tst_qqmlecmascript::numberToStringWithRadix() +{ + QJSEngine engine; + { + const QJSValue value = engine.evaluate(".5.toString(5)"); + QVERIFY(!value.isError()); + QVERIFY(value.toString().startsWith("0.2222222222")); + } + { + const QJSValue value = engine.evaluate(".05.toString(5)"); + QVERIFY(!value.isError()); + QVERIFY(value.toString().startsWith("0.01111111111")); + } +} + QTEST_MAIN(tst_qqmlecmascript) #include "tst_qqmlecmascript.moc" |