aboutsummaryrefslogtreecommitdiff
path: root/paludis/util/process_TEST.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-19 18:04:39 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-21 14:58:16 +0100
commit625454e26c1ea5fa5640135d34f043adeec54527 (patch)
tree9bbb05b6f7679c9be4e72c4c0d8d3b9f7fec989b /paludis/util/process_TEST.cc
parentef7126699addb2a5a3bf74dfba5fd5c1f44b5b93 (diff)
downloadpaludis-625454e26c1ea5fa5640135d34f043adeec54527.tar.gz
paludis-625454e26c1ea5fa5640135d34f043adeec54527.tar.xz
Process::setenv
Diffstat (limited to 'paludis/util/process_TEST.cc')
-rw-r--r--paludis/util/process_TEST.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/paludis/util/process_TEST.cc b/paludis/util/process_TEST.cc
index 9bf066610..9688c07c7 100644
--- a/paludis/util/process_TEST.cc
+++ b/paludis/util/process_TEST.cc
@@ -145,5 +145,21 @@ namespace test_cases
TEST_CHECK(! std::getline(stdout_stream, s));
}
} test_grab_stdout_long;
+
+ struct SetenvTest : TestCase
+ {
+ SetenvTest() : TestCase("setenv") { }
+
+ void run()
+ {
+ std::stringstream stdout_stream;
+ Process printenv_process(ProcessCommand({"printenv", "monkey"}));
+ printenv_process.capture_stdout(stdout_stream);
+ printenv_process.setenv("monkey", "in space");
+
+ TEST_CHECK_EQUAL(printenv_process.run().wait(), 0);
+ TEST_CHECK_EQUAL(stdout_stream.str(), "in space\n");
+ }
+ } test_setenv;
}