[libmessage-passing-zeromq-perl] 25/78: Add a test for PSUH/PULL in the opposite connect direction - this now works

Jonas Smedegaard js at alioth.debian.org
Mon Sep 30 09:28:20 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libmessage-passing-zeromq-perl.

commit 6752e6ffbfa7376adff47e6d30160053cbd7b046
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Sun Mar 18 11:16:12 2012 +0000

    Add a test for PSUH/PULL in the opposite connect direction - this now works
---
 t/pushpull.t |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/t/pushpull.t b/t/pushpull.t
new file mode 100644
index 0000000..3442a5b
--- /dev/null
+++ b/t/pushpull.t
@@ -0,0 +1,32 @@
+use strict;
+use warnings;
+
+use Test::More;
+
+use Log::Stash::Input::ZeroMQ;
+use Log::Stash::Output::ZeroMQ;
+use Log::Stash::Output::Test;
+my $test = Log::Stash::Output::Test->new;
+my $input = Log::Stash::Input::ZeroMQ->new(
+        connect => 'tcp://127.0.0.1:5558',
+        socket_type => 'PULL',
+        output_to => $test,
+);
+
+my $output = Log::Stash::Output::ZeroMQ->new(
+    socket_bind => 'tcp://127.0.0.1:5558',
+    socket_type => 'PUSH',
+);
+my $cv = AnyEvent->condvar;
+my $t; $t = AnyEvent->timer(
+    after => 1,
+    cb => sub {
+        $output->consume({});
+        $t = AnyEvent->timer(after => 1, cb => sub { $cv->send });
+    },
+);
+$cv->recv;
+
+is_deeply [$test->messages], [{}];
+done_testing;
+

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmessage-passing-zeromq-perl.git



More information about the Pkg-perl-cvs-commits mailing list