commit aecf785008c3e4ce40718958b6d3bc70edd2dfce
parent ca376bed2e78ef1eeded20efba6ef4e93b77beec
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sat, 28 Jul 2012 00:01:48 +0200
fix test cases, add caveats to README
Diffstat:
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/README b/README
@@ -131,3 +131,13 @@ IRC servers will usually throttle clients. If want to set up chatty bots, you
will need to have control over the IRC server and configure it adequately (for
ircd-hybrid, look at "can_flood" and also at "default_floodcount").
+irctk will exit whenever it has sent all messages on stdin to the server. If the
+server throttles it, then it might exit before all messages have been
+delivered, and some may get lost. Use -i, or sleep for a few seconds before
+closing stdin.
+
+irctk will exit if stdin is /dev/null. TODO tail -f /dev/null
+
+irctk may say greedily the first things it sees on stdin while things to say in
+parallel might be available. TODO
+
diff --git a/test/order_2.sh b/test/order_2.sh
@@ -26,8 +26,9 @@ cat >tosay <<EOF
[#test1,#test2,#test3] m
EOF
-(sleep 5; cat tosay) |
- ../irctk op@localhost \#test1 \#test2 \#test3 2>/dev/null > /dev/null&
+(sleep 4; cat tosay |
+ ../irctk -I 10 op@localhost \#test1 \#test2 \#test3 2>/dev/null \
+ > /dev/null) &
sleep 1
PID=$!
cat fifo1 |
@@ -38,5 +39,7 @@ wait $PID
sleep 1
kill $PID1
-diff <(cut -f2 -d' ' tosay | sort) <(cut -f3 -d' ' heard_message)
+diff <(sed 's/^[^,]*,[^,]*$/&\n&/' tosay |
+ sed 's/^[^,]*,[^,]*,[^,]*$/&\n&\n&/' |
+ cut -f2 -d' ' | sort) <(cut -f3 -d' ' heard_message)