commit 7ae1070b8b057ae90a7f729a2fc1e2ab422b1de8
parent 7ba7789acff0f89f2953fc02bf9866c1261e0541
Author: Antoine Amarilli <a3nm@a3nm.net>
Date: Fri, 27 Jul 2012 22:43:26 +0200
add test which exposes bug
Diffstat:
1 file changed, 42 insertions(+), 0 deletions(-)
diff --git a/test/order_2.sh b/test/order_2.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+
+trap 'kill $(jobs -p)' EXIT
+
+cat >tosay <<EOF
+[#test1] a
+[#test1] b
+[#test1,#test2] c
+[#test2,#test1] d
+[#test1] e
+[#test2] e
+[#test2] f
+[#test1] f
+[#test1] g
+[#test3] a
+[#test1,#test3] h
+[#test1] i
+[#test2] g
+[#test2] h
+[#test2] i
+[#test2] j
+[#test3] i
+[#test1,#test2,#test3] k
+[#test1] l
+[#test3,#test2] l
+[#test1,#test2,#test3] m
+EOF
+
+(sleep 5; cat tosay) |
+ ../irctk op@localhost \#test1 \#test2 \#test3 2>/dev/null > /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 <(cut -f2 -d' ' tosay | sort) <(cut -f3 -d' ' heard_message)
+