aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/getopt/ut/last_getopt_ut.cpp
diff options
context:
space:
mode:
authorAlexander Smirnov <alex@ydb.tech>2024-11-22 09:21:01 +0000
committerAlexander Smirnov <alex@ydb.tech>2024-11-22 09:21:01 +0000
commita7cac42c868ca5722777ccee944217410812e72c (patch)
tree7bff7ce2a3ade72f6f15dfc634490d13628066ee /library/cpp/getopt/ut/last_getopt_ut.cpp
parenta18f18d81996ca8e681bb6cabd441b52833d99bf (diff)
parent9478cfdab4217d3710b96329466825bf47111d7d (diff)
downloadydb-a7cac42c868ca5722777ccee944217410812e72c.tar.gz
Merge branch 'rightlib' into mergelibs-241122-0919
Diffstat (limited to 'library/cpp/getopt/ut/last_getopt_ut.cpp')
-rw-r--r--library/cpp/getopt/ut/last_getopt_ut.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/library/cpp/getopt/ut/last_getopt_ut.cpp b/library/cpp/getopt/ut/last_getopt_ut.cpp
index b517ea359d..8fc9b7ef16 100644
--- a/library/cpp/getopt/ut/last_getopt_ut.cpp
+++ b/library/cpp/getopt/ut/last_getopt_ut.cpp
@@ -449,6 +449,19 @@ Y_UNIT_TEST_SUITE(TLastGetoptTests) {
tester.AcceptEndOfFreeArgs();
}
+ Y_UNIT_TEST(TestEqParseOnlyRequiredArgument) {
+ TOptsNoDefault opts;
+
+ opts.AddLongOption("eq-only").RequiredArgument().DisableSpaceParse();
+
+ TOptsParseResultTestWrapper res(&opts, V({"cmd", "--eq-only=value"}));
+ UNIT_ASSERT_EQUAL(res.Get("eq-only"), "value"sv);
+
+ UNIT_ASSERT_EXCEPTION(
+ TOptsParseResultTestWrapper(&opts, V({"cmd", "--eq-only", "value"})),
+ TUsageException);
+ }
+
Y_UNIT_TEST(TestStoreResult) {
TOptsNoDefault opts;
TString data;