Skip to content
Permalink
Browse files

Add more tests

  • Loading branch information
DelazJ authored and m-kuhn committed Dec 23, 2017
1 parent 49a3af0 commit c0637103529fd0f6ed64fe53a410ab9aa80f75b1
Showing with 3 additions and 0 deletions.
  1. +3 −0 tests/src/core/testqgsexpression.cpp
@@ -616,11 +616,14 @@ class TestQgsExpression: public QObject
QTest::newRow( "round(1234.4) - round down to int" ) << "round(1234.4)" << false << QVariant( 1234 );
QTest::newRow( "max(1)" ) << "max(1)" << false << QVariant( 1. );
QTest::newRow( "max(1,3.5,-2.1)" ) << "max(1,3.5,-2.1)" << false << QVariant( 3.5 );
QTest::newRow( "max(3.5,-2.1,1)" ) << "max(3.5,-2.1,1)" << false << QVariant( 3.5 );
QTest::newRow( "max with null value" ) << "max(1,3.5,null)" << false << QVariant( 3.5 );
QTest::newRow( "max with null value first" ) << "max(null,-3.5,2)" << false << QVariant( 2. );
QTest::newRow( "min(-1.5)" ) << "min(-1.5)" << false << QVariant( -1.5 );
QTest::newRow( "min(-16.6,3.5,-2.1)" ) << "min(-16.6,3.5,-2.1)" << false << QVariant( -16.6 );
QTest::newRow( "min(5,3.5,-2.1)" ) << "min(5,3.5,-2.1)" << false << QVariant( -2.1 );
QTest::newRow( "min with null value" ) << "min(5,null,-2.1)" << false << QVariant( -2.1 );
QTest::newRow( "min with null value first" ) << "min(null,3.2,6.5)" << false << QVariant( 3.2 );
QTest::newRow( "clamp(-2,1,5)" ) << "clamp(-2,1,5)" << false << QVariant( 1.0 );
QTest::newRow( "clamp(min:=-2,value:=1,max:=5)" ) << "clamp(min:=-2,value:=1,max:=5)" << false << QVariant( 1.0 );
QTest::newRow( "clamp(-2,-10,5)" ) << "clamp(-2,-10,5)" << false << QVariant( -2.0 );

0 comments on commit c063710

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