Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add simple test
  • Loading branch information
rduivenvoorde committed Oct 31, 2019
1 parent 8f9d493 commit 56fa5f7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/src/core/testqgsexpression.cpp
Expand Up @@ -1284,6 +1284,7 @@ class TestQgsExpression: public QObject
QTest::newRow( "time - time" ) << "to_time('08:30:00') - to_time('05:15:00')" << false << QVariant( QgsInterval( 3 * 60 * 60 + 15 * 60 ) );
QTest::newRow( "epoch" ) << "epoch(to_datetime('2017-01-01T00:00:01+00:00'))" << false << QVariant( 1483228801000LL );
QTest::newRow( "epoch invalid date" ) << "epoch('invalid')" << true << QVariant();
QTest::newRow( "from_epoch" ) << "from_epoch(1483228801000)" << false << QVariant( QDateTime( QDate( 2017, 1, 1 ), QTime( 0, 0, 1 ), Qt::UTC ) );
QTest::newRow( "date from format" ) << "to_date('June 29, 2019','MMMM d, yyyy')" << false << QVariant( QDate( 2019, 6, 29 ) );
QTest::newRow( "date from format, wrong string" ) << "to_date('wrong.string.here','yyyy.MM.dd')" << true << QVariant();
QTest::newRow( "date from format, wrong format" ) << "to_date('2019-01-01','wrong')" << true << QVariant();
Expand Down

0 comments on commit 56fa5f7

Please sign in to comment.