commit 7288ae7d48d005090770c87d6c2fe90138ee8980
parent b0630d85943c93d95054bece6785d74df0aa8ba8
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Tue, 7 Aug 2012 22:02:14 +0200
add order_3.sh test
Diffstat:
1 file changed, 30 insertions(+), 0 deletions(-)
diff --git a/test/order_3.sh b/test/order_3.sh
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+trap 'kill $(jobs -p)' EXIT
+
+cat >tosay <<EOF
+[#test1] a
+[#test1] b
+[#test1,#test2] c
+[#test2,#test1] d
+[#test1] e
+[#test2] e
+[#test3] a
+EOF
+
+(sleep 4; cat tosay |
+../irctk -I 3 op@localhost \#test1 \#test2 \#test3 > /dev/null)&
+sleep 1
+PID=$!
+cat fifo1 |
+ ../irctk message@localhost \#test1 \#test2 \#test3 > heard_message &
+PID1=$!
+sleep 0.3
+wait $PID
+sleep 1
+kill $PID1
+
+diff <(sed 's/^[^,]*,[^,]*$/&\n&/' tosay |
+ sed 's/^[^,]*,[^,]*,[^,]*$/&\n&\n&/' |
+ cut -f2 -d' ' | sort) <(cut -f3 -d' ' heard_message)
+