OSDN Git Service

Corrected the expected results.
[shogi-server/shogi-server.git] / test / TC_before_agree.rb
1 require "baseclient"
2 require "kconv"
3
4 class TestBeforeAgree < BaseClient
5
6   def test_gote_logout_after_sente_agree
7     login
8     result  = cmd  "AGREE"
9     result2 = cmd2 "LOGOUT"
10
11     result  += read_nonblock(@socket1)
12     result2 += read_nonblock(@socket2)
13
14     assert(/^REJECT/ =~ result)
15     assert(/^REJECT/ =~ result2)
16   end
17
18   def test_sente_logout_after_gote_agree
19     login
20     result2 = cmd2 "AGREE"
21     result  = cmd  "LOGOUT"
22
23     result  += read_nonblock(@socket1)
24     result2 += read_nonblock(@socket2)
25
26     assert(/^REJECT/ =~ result)
27     assert(/^REJECT/ =~ result2)
28   end
29
30   def test_gote_logout_before_sente_agree
31     login
32     result  = ""
33     result2 = cmd2 "LOGOUT"
34
35     result  += read_nonblock(@socket1)
36     result2 += read_nonblock(@socket2)
37
38     assert(/^REJECT/ =~ result)
39     assert(/^REJECT/ =~ result2)
40   end
41
42   def test_sente_logout_before_gote_agree
43     login
44     result2 = ""
45     result  = cmd  "LOGOUT"
46
47     result  += read_nonblock(@socket1)
48     result2 += read_nonblock(@socket2)
49
50     assert(/^REJECT/ =~ result)
51     assert(/^REJECT/ =~ result2)
52   end
53 end