expanded tests

This commit is contained in:
gardners 2013-05-09 22:10:15 +09:30
parent bd848c73e2
commit c88da2d363

View File

@ -74,4 +74,37 @@ test_reflectedPly() {
assertStdoutGrep --stdout --stderr --matches=1 '^1:.*:unacknowledged:meshms:Message-1'
}
doc_reflectedPly="Sender == recipient works as expected"
setup_reflectedPly() {
setup
}
test_reflectedPly() {
executeOk_servald meshms add message 12345 67890 $SIDA1 $SIDA1 "Message-1"
executeOk_servald rhizome list
assert_rhizome_list --fromhere=1 --author=$SIDA1 ''
executeOk_servald meshms list messages $SIDA1 $SIDA1
assertStdoutLineCount '==' 4
assertStdoutGrep --stdout --stderr --matches=1 '^0:.*:received:meshms:Message-1'
assertStdoutGrep --stdout --stderr --matches=1 '^1:.*:unacknowledged:meshms:Message-1'
}
doc_twoPly="Send one message each way, no acks, correct order"
setup_twoPly() {
setup
}
test_twoPly() {
executeOk_servald meshms add message 12345 67890 $SIDA1 $SIDA2 "Message-1a"
executeOk_servald rhizome list
assert_rhizome_list --fromhere=1 --author=$SIDA1 ''
executeOk_servald meshms add message 12345 67890 $SIDA2 $SIDA1 "Message-2b"
executeOk_servald meshms list messages $SIDA1 $SIDA1
assertStdoutLineCount '==' 2
executeOk_servald meshms list messages $SIDA2 $SIDA2
assertStdoutLineCount '==' 2
executeOk_servald meshms list messages $SIDA1 $SIDA2
assertStdoutLineCount '==' 4
assertStdoutGrep --stdout --stderr --matches=1 '^0:.*:received:meshms:Message-2b'
assertStdoutGrep --stdout --stderr --matches=1 '^1:.*:unacknowledged:meshms:Message-1a'
}
runTests "$@"