OSDN Git Service

* Starting a buoy game by %%GAME caused an server error.
[shogi-server/shogi-server.git] / test / TC_oute_sennichite.rb
index 855c065..2938047 100644 (file)
@@ -13,5 +13,29 @@ class OuteSennichiteTest < ReadFileClient
     assert_match(/#OUTE_SENNICHITE.#LOSE/m, result1)
     assert_match(/#OUTE_SENNICHITE.#WIN/m, result2)
   end
+
+  def test_oute_sennichite2
+    csa = File.open(filepath("oute_sennichite2.csa")) {|f| f.read}
+    handshake(csa)
+    #cmd2 "%KACHI"
+    sleep 1
+    result1 = read_nonblock(@socket1)
+    result2 = read_nonblock(@socket2)
+    logout12
+    assert_match(/#OUTE_SENNICHITE.#WIN/m, result1)
+    assert_match(/#OUTE_SENNICHITE.#LOSE/m, result2)
+  end
+
+  def test_oute_sennichite3
+    csa = File.open(filepath("oute_sennichite3.csa")) {|f| f.read}
+    handshake(csa)
+    #cmd2 "%KACHI"
+    sleep 1
+    result1 = read_nonblock(@socket1)
+    result2 = read_nonblock(@socket2)
+    logout12
+    assert_match(/#OUTE_SENNICHITE.#LOSE/m, result1)
+    assert_match(/#OUTE_SENNICHITE.#WIN/m, result2)
+  end
 end # Client class