aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/shellcommand_ut.cpp
diff options
context:
space:
mode:
authorvlad-savinov <vlad-savinov@yandex-team.ru>2022-02-10 16:51:46 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:51:46 +0300
commitaa109021468e8848c0c4f46894b8cc74d390d4c3 (patch)
tree04fb88139bef69d6d03cbe56dfae1ab64d3f95e5 /util/system/shellcommand_ut.cpp
parentcf6e6821eefccdbf1103566edb4a651fe0388df7 (diff)
downloadydb-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.cpp52
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);
+ }
}