aboutsummaryrefslogtreecommitdiff
path: root/paludis/util/process_TEST.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/util/process_TEST.cc')
-rw-r--r--paludis/util/process_TEST.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/paludis/util/process_TEST.cc b/paludis/util/process_TEST.cc
index 0686e8c9f..be63e49d1 100644
--- a/paludis/util/process_TEST.cc
+++ b/paludis/util/process_TEST.cc
@@ -111,6 +111,21 @@ namespace test_cases
}
} test_grab_stdout;
+ struct GrabStdoutSingleCommandTest : TestCase
+ {
+ GrabStdoutSingleCommandTest() : TestCase("grab stdout single command") { }
+
+ void run()
+ {
+ std::stringstream stdout_stream;
+ Process echo_process(ProcessCommand("echo giant space monkey"));
+ echo_process.capture_stdout(stdout_stream);
+
+ TEST_CHECK_EQUAL(echo_process.run().wait(), 0);
+ TEST_CHECK_EQUAL(stdout_stream.str(), "giant space monkey\n");
+ }
+ } test_grab_stdout_single_command;
+
struct GrabStderrTest : TestCase
{
GrabStderrTest() : TestCase("grab stderr") { }