From ff86eb8f9a7f0cde0b51b2fbd9c8608d8846b140 Mon Sep 17 00:00:00 2001 From: Michael Santos Date: Wed, 15 Feb 2017 08:39:03 -0500 Subject: [PATCH] test: send a message using stdin --- test/10-groupchat.bats | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/10-groupchat.bats b/test/10-groupchat.bats index 7f4cc0d..bddd042 100644 --- a/test/10-groupchat.bats +++ b/test/10-groupchat.bats @@ -1,5 +1,10 @@ #!/usr/bin/env bats +[ "$XMPPIPE_USERNAME" ] +[ "$XMPPIPE_PASSWORD" ] +[ "$XMPPIPE_TEST_USERNAME" ] +[ "$XMPPIPE_TEST_PASSWORD" ] + @test "enter MUC" { xmppipe < /dev/null | grep -q "^p:available" } @@ -16,3 +21,8 @@ grep -q "^p:available:" $TMPDIR/stdout grep -q $MESSAGE $TMPDIR/stderr } + +@test "sending/receive message: stdin" { + (sleep 10; echo 'test123 ~!@#$' | xmppipe -o xmppipe-test -r user1 -u $XMPPIPE_TEST_USERNAME -p $XMPPIPE_TEST_PASSWORD) & + xmppipe -o xmppipe-test -s | egrep "^m:groupchat:[^/]+/user1:[^:]+:test123%20~%21@%23%24%0A" +}