irctk

libircclient binding for scripts
git clone https://a3nm.net/git/irctk/
Log | Files | Refs | README

commit 4c9548e501130aeca780d3f668a52451cc470c57
parent 74ecbd6a78eed2f80119bdb9477f4615a24aed6a
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Fri,  9 May 2014 19:10:59 +0200

make 1events.sh more resilient to server quirks

Diffstat:
test/1events.sh | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/test/1events.sh b/test/1events.sh @@ -32,13 +32,13 @@ cat > ref_message <<EOF [] -!- eventsop is now known as eventsop2 [#events_test1] -!- eventsop2 mode +n on #events_test1 [#events_test1] -!- eventsop2 mode -n on #events_test1 -[#events_test1] -!- eventsop2 has left #events_test1 (eventsop2) +[#events_test1] -!- eventsop2 has left #events_test1 [#events_test2] -!- eventsop2 changed the topic of #events_test2 to mytopic [#events_test2] -!- eventsc was kicked from #events_test2 by eventsop2 (kickarg) [#events_test2] <eventsop2> hello [#events_test2] *** eventsop2 blah [#events_test2] <eventsop2> /hello2 -[] -!- eventsop2 has quit ("quitarg") +[] -!- eventsop2 has quit (quitarg) EOF cat > ref_command <<EOF [#events_test1] <eventsc> /join #events_test1 @@ -83,6 +83,13 @@ kill $PID1 $PID2 $PID3 sleep 0.3 kill $PID4 -diff ref_message heard_message && diff ref_command heard_command \ +# must work around "Quit: " prefix and quotes problem +# must remove spurious /mode +i events +diff ref_message <( + sed ' + s/Quit: //; + s/\(has quit[^"]*\)"/\1/g; + s/\(has left[^(]*\) (.*/\1/g' heard_message | grep -v '+i') \ + && diff ref_command <(grep -v '+i' heard_command) \ && diff ref_nothing heard_nothing