gameServer2/src/protocol/mod.rs
changeset 12136 a4d22f197bd2
parent 12135 6273f89ab13d
child 12137 1525923cd7e3
--- a/gameServer2/src/protocol/mod.rs	Thu Jan 05 19:07:01 2017 +0300
+++ b/gameServer2/src/protocol/mod.rs	Fri Jan 06 01:00:21 2017 +0300
@@ -4,6 +4,7 @@
 
 mod messages;
 mod hwprotocol;
+mod lexer;
 
 pub struct FrameDecoder {
     buf: netbuf::Buf,
@@ -24,3 +25,9 @@
         &self.buf[..]
     }
 }
+
+#[test]
+fn testparser() {
+    assert_eq!(messages::HWProtocolMessage::Nick("hey".to_string()),
+               hwprotocol::parse_ProtocolMessage("NICK\nhey\n\n").unwrap());
+}