diff options
author | Alexander Smirnov <alex@ydb.tech> | 2024-11-22 09:21:01 +0000 |
---|---|---|
committer | Alexander Smirnov <alex@ydb.tech> | 2024-11-22 09:21:01 +0000 |
commit | a7cac42c868ca5722777ccee944217410812e72c (patch) | |
tree | 7bff7ce2a3ade72f6f15dfc634490d13628066ee /library/cpp/getopt/ut/last_getopt_ut.cpp | |
parent | a18f18d81996ca8e681bb6cabd441b52833d99bf (diff) | |
parent | 9478cfdab4217d3710b96329466825bf47111d7d (diff) | |
download | ydb-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.cpp | 13 |
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; |