1 //===- llvm/unittest/ADT/SetVector.cpp ------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // SetVector unit tests.
11 //===----------------------------------------------------------------------===//
13 #include "llvm/ADT/SetVector.h"
14 #include "gtest/gtest.h"
18 TEST(SetVector
, EraseTest
) {
24 auto I
= S
.erase(std::next(S
.begin()));
26 // Test that the returned iterator is the expected one-after-erase
27 // and the size/contents is the expected sequence {0, 2}.
28 EXPECT_EQ(std::next(S
.begin()), I
);
29 EXPECT_EQ(2u, S
.size());
30 EXPECT_EQ(0, *S
.begin());
31 EXPECT_EQ(2, *std::next(S
.begin()));