commit c5031f8f03e7e0cda7a840605acbc1845c919621
parent fbc165b58ba731475893db08900d60b1f4573cef
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Sat, 21 Jul 2012 02:39:19 +0200
improve event.sh
Diffstat:
2 files changed, 28 insertions(+), 1 deletion(-)
diff --git a/TODO b/TODO
@@ -10,8 +10,21 @@ si on est full unbuffered, attendre qu'un write sur stdout ait fini de
bloquer avant de considérer que le write a été vu pour last_nick et autres
sinon, vérifier que le delimit par lignes vides est opérationnel
http://www.iagora.com/~espel/sirc/sirc.html
+group options better
tracking:
- use user list given when joining
- handle multiple addresses
- use output_nick in channel names
+
+tests:
+- last active by default (timing)
+- rename-tracking, unique-names
+- various events, test event-to-command, event-to-nothing, event-to-message et
+ command-to-event
+
+last-active and reply:
+- last-goes
+- last-goes then last-said until \n
+- stack on things to manage with \n as delimiter
+
diff --git a/test/events.sh b/test/events.sh
@@ -22,6 +22,9 @@ cat > ref_message <<EOF
[#test2] -!- command has joined #test2
[#test1] -!- nothing has joined #test1
[#test2] -!- nothing has joined #test2
+[#test1] -!- useless has joined #test1
+[#test2] -!- useless has joined #test2
+[#test1] <useless> /join #wrong
[] -!- op is now known as op2
[#test1] -!- op2 mode +n on #test1
[#test1] -!- op2 mode -n on #test1
@@ -37,6 +40,9 @@ cat > ref_command <<EOF
[#test2] <command> /join #test2
[#test1] <nothing> /join #test1
[#test2] <nothing> /join #test2
+[#test1] <useless> /join #test1
+[#test2] <useless> /join #test2
+[#test1] <useless> / /join #wrong
[] <op> /nick op2
[#test1] <op2> /mode +n #test1
[#test1] <op2> /mode -n #test1
@@ -45,11 +51,13 @@ cat > ref_command <<EOF
[#test2] <op2> /kick command kickarg
EOF
cat > ref_nothing <<EOF
+[#test1] <useless> /join #wrong
[#test2] <op2> hello
[#test2] <op2> /hello2
EOF
-(sleep 3; cat tosay) | ../irctk -p op@localhost \#test1 \#test2 2>/dev/null &
+(sleep 5; cat tosay) |
+ ../irctk -p op@localhost \#test1 \#test2 2>/dev/null > /dev/null&
sleep 1
PID=$!
cat fifo1 | ../irctk -m message@localhost \#test1 \#test2 > heard_message &
@@ -60,9 +68,15 @@ PID2=$!
sleep 0.3
cat fifo3 | ../irctk -n nothing@localhost \#test1 \#test2 > heard_nothing &
PID3=$!
+sleep 0.3
+(echo '/join #wrong'; tail -f /dev/null) |
+ ../irctk -E0 useless@localhost \#test1 \#test2 > /dev/null &
+PID4=$!
wait $PID
sleep 1
kill $PID1 $PID2 $PID3
+sleep 0.3
+kill $PID4
diff ref_message heard_message && diff ref_command heard_command \
&& diff ref_nothing heard_nothing