Communicate test case works in the last commit

This commit is contained in:
arunmu 2016-03-16 12:15:00 +05:30
parent 18686a79ed
commit a96466ca18

View File

@ -6,7 +6,7 @@ using namespace subprocess;
void test_input()
{
auto p = Popen({"grep", "f"}, output{PIPE}, input{PIPE});
const char* msg = "one\two\three\four\five\n";
const char* msg = "one\ntwo\nthree\nfour\nfive\n";
p.send(msg, strlen(msg));
auto res = p.communicate(nullptr, 0);
std::cout << res.first.data() << std::endl;