Skip to content

Commit

Permalink
Followup 8e2b791, add unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Oct 11, 2015
1 parent 15af5a1 commit ecbd691
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/src/core/testqgsfields.cpp
Expand Up @@ -343,6 +343,11 @@ void TestQgsFields::indexFromName()
//indexFromName is case sensitive, fieldNameIndex isn't
QCOMPARE( fields.indexFromName( QString( "teStFiEld2" ) ), -1 );
QCOMPARE( fields.fieldNameIndex( QString( "teStFiEld2" ) ), 1 );

//test that fieldNameIndex prefers exact case matches over case insensitive matches
QgsField sameNameDifferentCase( QString( "teStFielD" ) );
fields.append( sameNameDifferentCase );
QCOMPARE( fields.fieldNameIndex( QString( "teStFielD" ) ), 3 );
}

void TestQgsFields::toList()
Expand Down

0 comments on commit ecbd691

Please sign in to comment.