Skip to content

Commit ecbd691

Browse files
committedOct 11, 2015
Followup 8e2b791, add unit test
1 parent 15af5a1 commit ecbd691

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎tests/src/core/testqgsfields.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,11 @@ void TestQgsFields::indexFromName()
343343
//indexFromName is case sensitive, fieldNameIndex isn't
344344
QCOMPARE( fields.indexFromName( QString( "teStFiEld2" ) ), -1 );
345345
QCOMPARE( fields.fieldNameIndex( QString( "teStFiEld2" ) ), 1 );
346+
347+
//test that fieldNameIndex prefers exact case matches over case insensitive matches
348+
QgsField sameNameDifferentCase( QString( "teStFielD" ) );
349+
fields.append( sameNameDifferentCase );
350+
QCOMPARE( fields.fieldNameIndex( QString( "teStFielD" ) ), 3 );
346351
}
347352

348353
void TestQgsFields::toList()

0 commit comments

Comments
 (0)
Please sign in to comment.