From c8482a7c9c43883e325c2ab31b58cb62abde7eba Mon Sep 17 00:00:00 2001
From: tldr <tldr@yandex-team.com>
Date: Thu, 21 Nov 2024 17:37:20 +0300
Subject: [arc][getopt]fix enforcment of RequiredArgument().DisableSpaceParse()
 commit_hash:9c2ada5b95be3f810d2750406d74d839bd2598ff

---
 library/cpp/getopt/ut/last_getopt_ut.cpp | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'library/cpp/getopt/ut/last_getopt_ut.cpp')

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;
-- 
cgit v1.2.3