irctk

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

commit 09aafa5c38bc432030f9a24d4a764e32cbd8ed18
parent 156c7c631ec78059a18b1f9280dbe14ca5223055
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Thu,  9 Aug 2012 22:50:32 +0200

add test for -u

Diffstat:
test/unique.sh | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+), 0 deletions(-)

diff --git a/test/unique.sh b/test/unique.sh @@ -0,0 +1,54 @@ +#!/bin/bash + +trap 'kill $(jobs -p)' EXIT + +mkdir -p unique +cd unique + +cat >a<<EOF +a1 +a2 +a3 +a4 +a5 +/nick uniqueb +a6 +a7 +EOF +cat >b<<EOF +b1 +/nick uniquec +b2 +/nick uniqued +b3 +b4 +b5 +EOF +cat >c<<EOF +c1 +c2 +c3 +c4 +EOF + +tail -f /dev/null | ../../irctk -u uniquel@localhost \#unique_test 2>/dev/null \ + > heard & +PIDA=$! +sleep 1 +cat a| ../../irctk uniquea@localhost \#unique_test > /dev/null & +PID1=$! +sleep 1 +cat b| ../../irctk uniqueb@localhost \#unique_test > /dev/null +cat c| ../../irctk uniquec@localhost \#unique_test > /dev/null & +PID3=$! +sleep 1 +wait $PID1 +wait $PID3 +sleep 1 +kill $PIDA + +cat a b c | grep -v nick | sed s'/^./<unique&> &/' | sort> ref +cut -d' ' -f2- heard | sort > heard2 + +diff ref heard2 +