summaryrefslogtreecommitdiff
path: root/src/autoplay/child_process_test.cc
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2016-06-01 18:58:58 -0700
committerScott Gasch <[email protected]>2016-06-01 18:58:58 -0700
commit3fd43cd5fcb22bb65bf2a92a25d95d801b11c9e0 (patch)
tree9b6443235d16ba17f094a1a1c7ae53d2bcb9267b /src/autoplay/child_process_test.cc
Initial checkin for typhoon chess engine.
Diffstat (limited to 'src/autoplay/child_process_test.cc')
-rw-r--r--src/autoplay/child_process_test.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/autoplay/child_process_test.cc b/src/autoplay/child_process_test.cc
new file mode 100644
index 0000000..d723701
--- /dev/null
+++ b/src/autoplay/child_process_test.cc
@@ -0,0 +1,13 @@
+#include "child_process.h"
+#include "gtest/gtest.h"
+
+TEST(ChildProcessTest, BasicUsage) {
+ util::ChildProcess ps("/usr/bin/bc");
+ ps.Start();
+ ps.Flush();
+ ps.Send("1 + 1\n");
+ char buf[128];
+ ps.Receive(buf, 128);
+ EXPECT_STREQ("2\n", buf);
+ ps.Stop();
+}