We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a80dd44 commit 7a19194Copy full SHA for 7a19194
llvm/unittests/ADT/STLExtrasTest.cpp
@@ -1349,6 +1349,33 @@ TEST(STLExtrasTest, LessSecond) {
1349
}
1350
1351
1352
+TEST(STLExtrasTest, Mismatch) {
1353
+ {
1354
+ const int MMIndex = 5;
1355
+ StringRef First = "FooBar";
1356
+ StringRef Second = "FooBaz";
1357
+ auto [MMFirst, MMSecond] = mismatch(First, Second);
1358
+ EXPECT_EQ(MMFirst, First.begin() + MMIndex);
1359
+ EXPECT_EQ(MMSecond, Second.begin() + MMIndex);
1360
+ }
1361
+
1362
1363
+ SmallVector<int> First = {0, 1, 2};
1364
+ SmallVector<int> Second = {0, 1, 2, 3};
1365
1366
+ EXPECT_EQ(MMFirst, First.end());
1367
+ EXPECT_EQ(MMSecond, Second.begin() + 3);
1368
1369
1370
1371
+ SmallVector<int> First = {0, 1};
1372
+ SmallVector<int> Empty;
1373
+ auto [MMFirst, MMEmpty] = mismatch(First, Empty);
1374
+ EXPECT_EQ(MMFirst, First.begin());
1375
+ EXPECT_EQ(MMEmpty, Empty.begin());
1376
1377
+}
1378
1379
struct Foo;
1380
struct Bar {};
1381
0 commit comments