aboutsummaryrefslogtreecommitdiff
path: root/paludis/util/process_TEST.cc
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-20 21:44:30 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-08-21 14:58:18 +0100
commit3342ab3add1fb1a60cb60f8e0b396c07db8a9b8b (patch)
treeb187dfb051338c9c29c9408807de9b16bdbc1bee /paludis/util/process_TEST.cc
parente0829dd6ab62d8bd25308fc806072d1b378a1523 (diff)
downloadpaludis-3342ab3add1fb1a60cb60f8e0b396c07db8a9b8b.tar.gz
paludis-3342ab3add1fb1a60cb60f8e0b396c07db8a9b8b.tar.xz
Process::clearenv
Diffstat (limited to 'paludis/util/process_TEST.cc')
-rw-r--r--paludis/util/process_TEST.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/paludis/util/process_TEST.cc b/paludis/util/process_TEST.cc
index 69fc5fdc1..0686e8c9f 100644
--- a/paludis/util/process_TEST.cc
+++ b/paludis/util/process_TEST.cc
@@ -381,5 +381,22 @@ namespace test_cases
TEST_CHECK_EQUAL(stderr_stream.str(), "prefix> monkey\nprefix> in\nprefix> space\n");
}
} test_prefix_stderr;
+
+ struct ClearenvTest : TestCase
+ {
+ ClearenvTest() : TestCase("clearenv") { }
+
+ void run()
+ {
+ ::setenv("BANANAS", "IN PYJAMAS", 1);
+ std::stringstream stdout_stream;
+ Process printenv_process(ProcessCommand({"printenv", "BANANAS"}));
+ printenv_process.capture_stdout(stdout_stream);
+ printenv_process.clearenv();
+
+ TEST_CHECK_EQUAL(printenv_process.run().wait(), 1);
+ TEST_CHECK_EQUAL(stdout_stream.str(), "");
+ }
+ } test_clearenv;
}