aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/getopt/ut/opt2_ut.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/getopt/ut/opt2_ut.cpp
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
downloadydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/getopt/ut/opt2_ut.cpp')
-rw-r--r--library/cpp/getopt/ut/opt2_ut.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/library/cpp/getopt/ut/opt2_ut.cpp b/library/cpp/getopt/ut/opt2_ut.cpp
index 0e7464747c..4f7b615037 100644
--- a/library/cpp/getopt/ut/opt2_ut.cpp
+++ b/library/cpp/getopt/ut/opt2_ut.cpp
@@ -1,5 +1,5 @@
#include <library/cpp/getopt/opt2.h>
-
+
#include <library/cpp/testing/unittest/registar.h>
//using namespace NLastGetopt;
@@ -8,25 +8,25 @@ Y_UNIT_TEST_SUITE(Opt2Test) {
Y_UNIT_TEST(TestSimple) {
int argc = 8;
char* argv[] = {
- (char*)"cmd",
- (char*)"--aaaa=aaaa",
- (char*)"zz",
- (char*)"-x1",
- (char*)"-x2",
- (char*)"-c",
- (char*)"-d8",
- (char*)"ww",
+ (char*)"cmd",
+ (char*)"--aaaa=aaaa",
+ (char*)"zz",
+ (char*)"-x1",
+ (char*)"-x2",
+ (char*)"-c",
+ (char*)"-d8",
+ (char*)"ww",
};
Opt2 opt(argc, argv, "A:b:cd:e:x:", 2, "aaaa=A");
- const char* edef = "edef";
- const char* a = opt.Arg('A', "<var_name> - usage of -A");
- int b = opt.Int('b', "<var_name> - usage of -b", 2);
- bool c = opt.Has('c', "usage of -c");
- int d = opt.Int('d', "<var_name> - usage of -d", 13);
- const char* e = opt.Arg('e', "<unused> - only default is really used", edef);
- const TVector<const char*>& x = opt.MArg('x', "<var_name> - usage of -x");
+ const char* edef = "edef";
+ const char* a = opt.Arg('A', "<var_name> - usage of -A");
+ int b = opt.Int('b', "<var_name> - usage of -b", 2);
+ bool c = opt.Has('c', "usage of -c");
+ int d = opt.Int('d', "<var_name> - usage of -d", 13);
+ const char* e = opt.Arg('e', "<unused> - only default is really used", edef);
+ const TVector<const char*>& x = opt.MArg('x', "<var_name> - usage of -x");
UNIT_ASSERT(!opt.AutoUsage("<L> <M>"));
UNIT_ASSERT_VALUES_EQUAL("aaaa", a);
@@ -46,17 +46,17 @@ Y_UNIT_TEST_SUITE(Opt2Test) {
Y_UNIT_TEST(TestErrors1) {
int argc = 4;
char* argv[] = {
- (char*)"cmd",
- (char*)"zz",
- (char*)"-c",
- (char*)"-e",
+ (char*)"cmd",
+ (char*)"zz",
+ (char*)"-c",
+ (char*)"-e",
};
Opt2 opt(argc, argv, "ce:", 2);
- const char* edef = "edef";
- bool c = opt.Has('c', "usage of -c");
- const char* e = opt.Arg('e', "<unused> - only default is really used", edef);
+ const char* edef = "edef";
+ bool c = opt.Has('c', "usage of -c");
+ const char* e = opt.Arg('e', "<unused> - only default is really used", edef);
UNIT_ASSERT(c);
UNIT_ASSERT_VALUES_EQUAL((void*)edef, e);
}