mirror of
https://github.com/arun11299/cpp-subprocess.git
synced 2025-08-05 12:56:23 -04:00
Add cat test case
This commit is contained in:
parent
169bde5c08
commit
b5a3d3fb47
15
test/test_cat.cc
Normal file
15
test/test_cat.cc
Normal 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;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user