Skip to content
Permalink
Browse files

tests: added coalesce coverage

  • Loading branch information
lynxlynxlynx committed Sep 7, 2012
1 parent 1111a60 commit 68cfb6c8efbd293da4d11d4f2cff636e0770a908
Showing with 3 additions and 0 deletions.
  1. +3 −0 tests/src/core/testqgsexpression.cpp
@@ -295,6 +295,9 @@ class TestQgsExpression: public QObject
QTest::newRow( "condition else" ) << "case when 1=0 then 'bad' else 678 end" << false << QVariant( 678 );
QTest::newRow( "condition null" ) << "case when length(123)=0 then 111 end" << false << QVariant();
QTest::newRow( "condition 2 when" ) << "case when 2>3 then 23 when 3>2 then 32 else 0 end" << false << QVariant( 32 );
QTest::newRow( "coalesce null" ) << "coalesce(NULL)" << false << QVariant( );
QTest::newRow( "coalesce mid-null" ) << "coalesce(1, NULL, 3)" << false << QVariant( 1 );
QTest::newRow( "coalesce exp" ) << "coalesce(NULL, 1+1)" << false << QVariant( 2 );

// Datetime functions
QTest::newRow( "to date" ) << "todate('2012-06-28')" << false << QVariant( QDate( 2012, 6, 28 ) );

0 comments on commit 68cfb6c

Please sign in to comment.
You can’t perform that action at this time.