diff options
author | vlad-savinov <vlad-savinov@yandex-team.ru> | 2022-02-10 16:51:46 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:51:46 +0300 |
commit | aa109021468e8848c0c4f46894b8cc74d390d4c3 (patch) | |
tree | 04fb88139bef69d6d03cbe56dfae1ab64d3f95e5 /util/system/shellcommand_ut.cpp | |
parent | cf6e6821eefccdbf1103566edb4a651fe0388df7 (diff) | |
download | ydb-aa109021468e8848c0c4f46894b8cc74d390d4c3.tar.gz |
Restoring authorship annotation for <vlad-savinov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/shellcommand_ut.cpp')
-rw-r--r-- | util/system/shellcommand_ut.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/util/system/shellcommand_ut.cpp b/util/system/shellcommand_ut.cpp index 9d849279d2..b1de429a01 100644 --- a/util/system/shellcommand_ut.cpp +++ b/util/system/shellcommand_ut.cpp @@ -15,7 +15,7 @@ #include <util/stream/str.h> #include <util/stream/mem.h> #include <util/string/strip.h> -#include <util/folder/tempdir.h> +#include <util/folder/tempdir.h> #if defined(_win_) #define NL "\r\n" @@ -465,29 +465,29 @@ Y_UNIT_TEST_SUITE(TShellCommandTest) { UNIT_ASSERT(options.OutputMode == TShellCommandOptions::HANDLE_STREAM); UNIT_ASSERT(options.ErrorMode == TShellCommandOptions::HANDLE_STREAM); } - Y_UNIT_TEST(TestForkCallback) { - TString tmpFile = TString("shellcommand_ut.test_for_callback.txt"); - TFsPath cwd(::NFs::CurrentWorkingDirectory()); - const TString tmpFilePath = cwd.Child(tmpFile); - - const TString text = "test output"; - auto afterForkCallback = [&tmpFilePath, &text]() -> void { - TFixedBufferFileOutput out(tmpFilePath); - out << text; - }; - - TShellCommandOptions options; - options.SetFuncAfterFork(afterForkCallback); - - const TString command = "ls"; - TShellCommand cmd(command, options); - cmd.Run(); - - UNIT_ASSERT(NFs::Exists(tmpFilePath)); - - TUnbufferedFileInput fileOutput(tmpFilePath); - TString firstLine = fileOutput.ReadLine(); - - UNIT_ASSERT_VALUES_EQUAL(firstLine, text); - } + Y_UNIT_TEST(TestForkCallback) { + TString tmpFile = TString("shellcommand_ut.test_for_callback.txt"); + TFsPath cwd(::NFs::CurrentWorkingDirectory()); + const TString tmpFilePath = cwd.Child(tmpFile); + + const TString text = "test output"; + auto afterForkCallback = [&tmpFilePath, &text]() -> void { + TFixedBufferFileOutput out(tmpFilePath); + out << text; + }; + + TShellCommandOptions options; + options.SetFuncAfterFork(afterForkCallback); + + const TString command = "ls"; + TShellCommand cmd(command, options); + cmd.Run(); + + UNIT_ASSERT(NFs::Exists(tmpFilePath)); + + TUnbufferedFileInput fileOutput(tmpFilePath); + TString firstLine = fileOutput.ReadLine(); + + UNIT_ASSERT_VALUES_EQUAL(firstLine, text); + } } |