OSDN Git Service

* [shogi-server] Ignore the last move of two sequential ones
[shogi-server/shogi-server.git] / test / TC_uchifuzume.rb
index 0107743..1798a0e 100644 (file)
@@ -5,24 +5,28 @@ class UchifuzumeTest < ReadFileClient
   def test_uchifuzume
     csa = File.open(filepath("uchifuzume.csa")) {|f| f.read}
     handshake(csa)
-    cmd2 "-0064FU"
-    cmd  "%TORYO"
+    result2 = cmd2 "-0064FU"
+    result1 = cmd  "%TORYO"
     sleep 1
-    result1 = read_nonblock(@socket1)
-    result2 = read_nonblock(@socket2)
+    result1 = cmd ""
+    result2 = cmd2 ""
+    result1 += read_nonblock(@socket1)
+    result2 += read_nonblock(@socket2)
     logout12
     assert_match(/#ILLEGAL_MOVE.*#WIN/m, result1)
     assert_match(/#ILLEGAL_MOVE.*#LOSE/m, result2)
   end
 
-  def est_not_uchifuzume
+  def test_not_uchifuzume
     csa = File.open(filepath("not_uchifuzume.csa")) {|f| f.read}
     handshake(csa)
     cmd2 "-0092FU"
     cmd  "%TORYO"
     sleep 1
-    result1 = read_nonblock(@socket1)
-    result2 = read_nonblock(@socket2)
+    result1 = cmd ""
+    result2 = cmd2 ""
+    result1 += read_nonblock(@socket1)
+    result2 += read_nonblock(@socket2)
     logout12
     assert_match(/#LOSE/m, result1)
     assert_match(/#WIN/m, result2)