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; +}