From b5a3d3fb4786e631ea9492d26aa6ebcb63e3b9ea Mon Sep 17 00:00:00 2001 From: arunmu Date: Thu, 17 Mar 2016 12:56:40 +0530 Subject: [PATCH] Add cat test case --- test/test_cat.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 test/test_cat.cc diff --git a/test/test_cat.cc b/test/test_cat.cc new file mode 100644 index 0000000..de8778f --- /dev/null +++ b/test/test_cat.cc @@ -0,0 +1,15 @@ +#include +#include "../subprocess.hpp" + +using namespace subprocess; + +int main() { + auto p = Popen({"cat", "-"}, + input{PIPE}, + output{PIPE}); + const char* msg = "through stdin to stdout"; + auto res = p.communicate(msg, strlen(msg)).first; + std::cout << res.buf.data() << std::endl; + + return 0; +}