@@ -318,11 +318,17 @@ TEST(TypeTest, List) {
318318 ASSERT_THAT (list.GetFieldById (5 ), ::testing::Optional (field));
319319 ASSERT_THAT (list.GetFieldByIndex (0 ), ::testing::Optional (field));
320320 ASSERT_THAT (list.GetFieldByName (" element" ), ::testing::Optional (field));
321+ ASSERT_THAT (list.GetFieldByNameCaseInsensitive (" element" ),
322+ ::testing::Optional (field));
323+ ASSERT_THAT (list.GetFieldByNameCaseInsensitive (" ELEMENT" ),
324+ ::testing::Optional (field));
321325
322326 ASSERT_EQ (std::nullopt , list.GetFieldById (0 ));
323327 ASSERT_EQ (std::nullopt , list.GetFieldByIndex (1 ));
324328 ASSERT_EQ (std::nullopt , list.GetFieldByIndex (-1 ));
325329 ASSERT_EQ (std::nullopt , list.GetFieldByName (" foo" ));
330+ ASSERT_EQ (std::nullopt , list.GetFieldByNameCaseInsensitive (" foo" ));
331+ ASSERT_EQ (std::nullopt , list.GetFieldByNameCaseInsensitive (" FOO" ));
326332 }
327333 ASSERT_THAT (
328334 []() {
@@ -347,12 +353,15 @@ TEST(TypeTest, Map) {
347353 ASSERT_THAT (map.GetFieldByIndex (0 ), ::testing::Optional (key));
348354 ASSERT_THAT (map.GetFieldByIndex (1 ), ::testing::Optional (value));
349355 ASSERT_THAT (map.GetFieldByName (" key" ), ::testing::Optional (key));
356+ ASSERT_THAT (map.GetFieldByNameCaseInsensitive (" kEY" ), ::testing::Optional (key));
350357 ASSERT_THAT (map.GetFieldByName (" value" ), ::testing::Optional (value));
358+ ASSERT_THAT (map.GetFieldByName (" vALUE" ), ::testing::Optional (value));
351359
352360 ASSERT_EQ (std::nullopt , map.GetFieldById (0 ));
353361 ASSERT_EQ (std::nullopt , map.GetFieldByIndex (2 ));
354362 ASSERT_EQ (std::nullopt , map.GetFieldByIndex (-1 ));
355363 ASSERT_EQ (std::nullopt , map.GetFieldByName (" element" ));
364+ ASSERT_EQ (std::nullopt , map.GetFieldByName (" elemENt" ));
356365 }
357366 ASSERT_THAT (
358367 []() {
@@ -386,12 +395,17 @@ TEST(TypeTest, Struct) {
386395 ASSERT_THAT (struct_.GetFieldByIndex (0 ), ::testing::Optional (field1));
387396 ASSERT_THAT (struct_.GetFieldByIndex (1 ), ::testing::Optional (field2));
388397 ASSERT_THAT (struct_.GetFieldByName (" foo" ), ::testing::Optional (field1));
398+ ASSERT_THAT (struct_.GetFieldByName (" FOO" ), ::testing::Optional (field1));
389399 ASSERT_THAT (struct_.GetFieldByName (" bar" ), ::testing::Optional (field2));
400+ ASSERT_THAT (struct_.GetFieldByNameCaseInsensitive (" bar" ),
401+ ::testing::Optional (field2));
390402
391403 ASSERT_EQ (std::nullopt , struct_.GetFieldById (0 ));
392404 ASSERT_EQ (std::nullopt , struct_.GetFieldByIndex (2 ));
393405 ASSERT_EQ (std::nullopt , struct_.GetFieldByIndex (-1 ));
394406 ASSERT_EQ (std::nullopt , struct_.GetFieldByName (" element" ));
407+ ASSERT_EQ (std::nullopt , struct_.GetFieldByNameCaseInsensitive (" element" ));
408+ ASSERT_EQ (std::nullopt , struct_.GetFieldByNameCaseInsensitive (" ELEMENT" ));
395409 }
396410 ASSERT_THAT (
397411 []() {
0 commit comments