diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:17 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:17 +0300 |
commit | d3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch) | |
tree | dd4bd3ca0f36b817e96812825ffaf10d645803f2 /library/cpp/getopt/ut/opt_ut.cpp | |
parent | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff) | |
download | ydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/getopt/ut/opt_ut.cpp')
-rw-r--r-- | library/cpp/getopt/ut/opt_ut.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/getopt/ut/opt_ut.cpp b/library/cpp/getopt/ut/opt_ut.cpp index 031105b4cb..441aa493a0 100644 --- a/library/cpp/getopt/ut/opt_ut.cpp +++ b/library/cpp/getopt/ut/opt_ut.cpp @@ -1,5 +1,5 @@ #include <library/cpp/getopt/opt.h> - + #include <library/cpp/testing/unittest/registar.h> #include <util/string/vector.h> @@ -7,7 +7,7 @@ Y_UNIT_TEST_SUITE(OptTest) { Y_UNIT_TEST(TestSimple) { int argc = 3; char* argv[] = { - (char*)"cmd", (char*)"-x"}; + (char*)"cmd", (char*)"-x"}; Opt opt(argc, argv, ""); opt.Err = false; // be quiet UNIT_ASSERT_VALUES_EQUAL('?', opt.Get()); @@ -18,9 +18,9 @@ Y_UNIT_TEST_SUITE(OptTest) { Y_UNIT_TEST(TestFreeArguments) { Opt::Ion options[] = { - {"some-option", Opt::WithArg, nullptr, 123}, - {nullptr, Opt::WithoutArg, nullptr, 0}}; - const char* argv[] = {"cmd", "ARG1", "-some-option", "ARG2", "ARG3", nullptr}; + {"some-option", Opt::WithArg, nullptr, 123}, + {nullptr, Opt::WithoutArg, nullptr, 0}}; + const char* argv[] = {"cmd", "ARG1", "-some-option", "ARG2", "ARG3", nullptr}; int argc = 5; Opt opts(argc, argv, "", options); @@ -30,10 +30,10 @@ Y_UNIT_TEST_SUITE(OptTest) { Y_UNIT_TEST(TestLongOption) { const int SOME_OPTION_ID = 12345678; Opt::Ion options[] = { - {"some-option", Opt::WithArg, nullptr, SOME_OPTION_ID}, - {nullptr, Opt::WithoutArg, nullptr, 0}}; + {"some-option", Opt::WithArg, nullptr, SOME_OPTION_ID}, + {nullptr, Opt::WithoutArg, nullptr, 0}}; for (int doubleDash = 0; doubleDash <= 1; ++doubleDash) { - const char* argv[] = {"cmd", "ARG1", (doubleDash ? "--some-option" : "-some-option"), "ARG2", "ARG3", nullptr}; + const char* argv[] = {"cmd", "ARG1", (doubleDash ? "--some-option" : "-some-option"), "ARG2", "ARG3", nullptr}; int argc = 5; Opt opts(argc, argv, "", options); @@ -42,7 +42,7 @@ Y_UNIT_TEST_SUITE(OptTest) { while ((optlet = opts.Get()) != EOF) { if (optlet == SOME_OPTION_ID) { optionValue = opts.GetArg(); - } else { + } else { UNIT_FAIL("don't expected any options, except -some-option"); } } |