summaryrefslogtreecommitdiff
path: root/libcody/tests/01-serialize/connect.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libcody/tests/01-serialize/connect.cc')
-rw-r--r--libcody/tests/01-serialize/connect.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/libcody/tests/01-serialize/connect.cc b/libcody/tests/01-serialize/connect.cc
new file mode 100644
index 00000000000..85277c844af
--- /dev/null
+++ b/libcody/tests/01-serialize/connect.cc
@@ -0,0 +1,30 @@
+
+// Test client connection handshake
+// RUN: <<HELLO 1 TESTING
+// RUN: $subdir$stem | ezio -p OUT $test |& ezio -p ERR $test
+// RUN-END:
+
+// OUT-NEXT:^HELLO {:[0-9]+} TEST IDENT$
+// OUT-NEXT:$EOF
+
+// ERR-NEXT:Code:{:[0-9]+}$
+// ERR-NEXT:Version:1$
+// ERR-NEXT:$EOF
+
+
+// Cody
+#include "cody.hh"
+// C++
+#include <iostream>
+
+using namespace Cody;
+
+int main (int, char *[])
+{
+ Client client (0, 1);
+
+ auto token = client.Connect ("TEST", "IDENT");
+
+ std::cerr << "Code:" << token.GetCode () << '\n';
+ std::cerr << "Version:" << token.GetInteger () << '\n';
+}