MCPcopy Create free account
hub / github.com/arun11299/cpp-subprocess / test_read_all

Function test_read_all

test/test_subprocess.cc:66–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64}
65
66void test_read_all()
67{
68 Popen p = Popen({"echo", "12345678"}, output{PIPE});
69
70 std::vector<char> buf(6);
71 int rbytes = util::read_all(p.output(), buf);
72
73 std::string out(buf.begin(), buf.end());
74
75 assert(out == "12345678\n" && rbytes == 9); // echo puts a new line at the end of output
76 std::cout << "read_all() succeeded" << std::endl;
77}
78
79void test_simple_cmd()
80{

Callers

nothing calls this directly

Calls 3

PopenClass · 0.85
read_allFunction · 0.85
outputMethod · 0.45

Tested by

no test coverage detected