Add cat test case

This commit is contained in:
arunmu 2016-03-17 12:56:40 +05:30
parent 169bde5c08
commit b5a3d3fb47

15
test/test_cat.cc Normal file
View File

@ -0,0 +1,15 @@
#include <iostream>
#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;
}