aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/getopt/ut/last_getopt_ut.cpp
diff options
context:
space:
mode:
authorar7is7 <ar7is7@yandex-team.com>2022-12-23 13:04:52 +0300
committerar7is7 <ar7is7@yandex-team.com>2022-12-23 13:04:52 +0300
commit9c0a33e446c7a410d4f1f80cbea29e070841ddb4 (patch)
tree0aaf481dd264e9bb20fca7308c3cb64c261b7025 /library/cpp/getopt/ut/last_getopt_ut.cpp
parente42806e60a2eab5a05348a0430b8e46b63cb0c9e (diff)
downloadydb-9c0a33e446c7a410d4f1f80cbea29e070841ddb4.tar.gz
Allow to use std::vector in AppendTo
Diffstat (limited to 'library/cpp/getopt/ut/last_getopt_ut.cpp')
-rw-r--r--library/cpp/getopt/ut/last_getopt_ut.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp
index c2ee4f0c40..b517ea359d 100644
--- a/library/cpp/getopt/ut/last_getopt_ut.cpp
+++ b/library/cpp/getopt/ut/last_getopt_ut.cpp
@@ -736,15 +736,21 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) {
Y_UNIT_TEST(TestAppendTo) {
TVector<int> ints;
+ std::vector<std::string> strings;
TOptsNoDefault opts;
opts.AddLongOption("size").AppendTo(&ints);
+ opts.AddLongOption("value").AppendTo(&strings);
- TOptsParseResultTestWrapper r(&opts, V({"cmd", "--size=17", "--size=19"}));
+ TOptsParseResultTestWrapper r(&opts, V({"cmd", "--size=17", "--size=19", "--value=v1", "--value=v2"}));
UNIT_ASSERT_VALUES_EQUAL(size_t(2), ints.size());
UNIT_ASSERT_VALUES_EQUAL(17, ints.at(0));
UNIT_ASSERT_VALUES_EQUAL(19, ints.at(1));
+
+ UNIT_ASSERT_VALUES_EQUAL(size_t(2), strings.size());
+ UNIT_ASSERT_VALUES_EQUAL("v1", strings.at(0));
+ UNIT_ASSERT_VALUES_EQUAL("v2", strings.at(1));
}
Y_UNIT_TEST(TestEmplaceTo) {