File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -3127,6 +3127,22 @@ class TestQgsExpression: public QObject
3127
3127
QCOMPARE ( QgsExpression::formatPreviewString ( QVariant ( stringList ) ),
3128
3128
QString ( " <i><array: 'One', 'Two', 'A very long string that is going to be trunca…></i>" ) );
3129
3129
}
3130
+
3131
+ void test_nowStatic ()
3132
+ {
3133
+ QgsExpression e ( QStringLiteral ( " now()" ) );
3134
+ QgsExpressionContext ctx;
3135
+ e.prepare ( &ctx );
3136
+ QVariant v = e.evaluate ();
3137
+ qDebug () << v.toString ();
3138
+ qDebug () << v.toDateTime ().toMSecsSinceEpoch ();
3139
+ QTest::qSleep ( 1000 );
3140
+ QVariant v2 = e.evaluate ();
3141
+ qDebug () << v2.toString ();
3142
+ qDebug () << v2.toDateTime ().toMSecsSinceEpoch ();
3143
+
3144
+ QCOMPARE ( v.toDateTime ().toMSecsSinceEpoch (), v2.toDateTime ().toMSecsSinceEpoch () );
3145
+ }
3130
3146
};
3131
3147
3132
3148
QGSTEST_MAIN ( TestQgsExpression )
You can’t perform that action at this time.
0 commit comments