Commit 072988c3 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Added a few tests. Accidentally discover bug 594.

parent 1cb2a0ae
......@@ -33,6 +33,19 @@
# FIXME (bug 590): If the request requested in bug 590 is implemented,
# it should also be checked here.
proc check_pos {actual wanted} {
global test
set test "Correct position of membership returned"
setup_xfail "*-*-*" "Bug 594"
if {$actual == $wanted} {
pass "$test"
} else {
fail "$test (got pos $actual instead of $wanted)"
}
unset test
}
#
# Startup and create the players
#
......@@ -76,7 +89,7 @@ send "1009 62 8 [holl "p8"] 0\n"
simple_expect "=1009"
# Create and log in as gazonk (person 9). This is the observer.
client_start 0
client_start 3
send "A6Hgazonk\n"
simple_expect "LysKOM"
send "1010 80 0 { }\n"
......@@ -138,14 +151,32 @@ simple_expect "=1024"
talk_to client 0
# foo does get-unread-confs of foo. Should return the empty list.
send "1025 52 6\n"
simple_expect "=1025 0 \\*"
# foo does get-membership of foo. Should return 4 { 6 10 11 12 }.
send "1026 99 6 0 100 1\n"
simple_expect "=1026 4 { 0 $any_time 6 255 0 0 \\* 6 $any_time 00000000 1 $any_time 10 200 0 0 \\* 7 $any_time 10000000 2 $any_time 11 200 0 0 \\* 7 $any_time 10000000 3 $any_time 12 200 0 0 \\* 7 $any_time 10000000 }"
# foo does get-membership-old of foo. Should return 4 { 6 10 11 12 }.
send "1027 46 6 0 100 1\n"
simple_expect "=1027 4 { $any_time 6 255 0 0 \\* $any_time 10 200 0 0 \\* $any_time 11 200 0 0 \\* $any_time 12 200 0 0 \\* }"
# foo does query-read-texts on foo and 10, 11 and 12. Should get results.
send "1028 98 6 10\n"
simple_expect "=1028 1 $any_time 10 200 0 0 \\* 7 $any_time 10000000"
send "1029 98 6 11\n"
simple_expect "=1029 2 $any_time 11 200 0 0 \\* 7 $any_time 10000000"
send "1030 98 6 12\n"
simple_expect "=1030 3 $any_time 12 200 0 0 \\* 7 $any_time 10000000"
# foo does query-read-texts-old on foo and 10, 11 and 12. Should get results.
send "1031 9 6 10\n"
simple_expect "=1031 $any_time 10 200 0 0 \\*"
send "1032 9 6 11\n"
simple_expect "=1032 $any_time 11 200 0 0 \\*"
send "1033 9 6 12\n"
simple_expect "=1033 $any_time 12 200 0 0 \\*"
# foo does <FIXME (bug 590)> on foo and 10, 11 and 12. Should get results.
......@@ -153,15 +184,41 @@ talk_to client 0
# gazonk examines foo.
#
talk_to client 3
# gazonk does get-unread-confs of foo. Should return the empty list.
send "1034 52 6\n"
simple_expect "=1034 0 \\*"
# gazonk does get-membership of foo. Should return 4 { 6 11 12 }.
# gazonk does get-membership of foo. Should return 3 { 6 11 12 }.
send "1035 99 6 0 100 1\n"
simple_expect "=1035 3 { 0 $any_time 6 255 0 0 \\* 6 $any_time 00000000 1 $any_time 11 200 0 0 \\* 7 $any_time 10000000 2 $any_time 12 200 0 0 \\* 7 $any_time 10000000 }"
# (Just a quick check: does the renumber work properly even if we don't
# start from the beginning of the list?)
send "1036 99 6 2 100 1\n"
simple_expect "=1036 1 { 2 $any_time 12 200 0 0 \\* 7 $any_time 10000000 }"
# gazonk does get-membership-old of foo. Should return 4 { 6 11 12 }.
# gazonk does get-membership-old of foo. Should return 3 { 6 11 12 }.
send "1037 46 6 0 100 1\n"
simple_expect "=1037 3 { $any_time 6 255 0 0 \\* $any_time 11 200 0 0 \\* $any_time 12 200 0 0 \\* }"
# gazonk does query-read-texts on foo and 10, 11 and 12. 10 should fail.
send "1038 98 6 10\n"
simple_expect "%1038 9 10"
send "1039 98 6 11\n"
extracting_expect "=1039 (1|2) $any_time 11 200 0 0 \\* 7 $any_time 10000000" pos 1
check_pos $pos 1
send "1040 98 6 12\n"
extracting_expect "=1040 (2|3) $any_time 12 200 0 0 \\* 7 $any_time 10000000" pos 1
check_pos $pos 2
# gazonk does query-read-texts-old on foo and 10, 11 and 12. 10 should fail.
send "1041 9 6 10\n"
simple_expect "%1041 9 10"
send "1042 9 6 11\n"
simple_expect "=1042 $any_time 11 200 0 0 \\*"
send "1043 9 6 12\n"
simple_expect "=1043 $any_time 12 200 0 0 \\*"
# gazonk does <FIXME (bug 590)> on foo and 10, 11 and 12. 10 should fail.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment