pseudo-fork tests (untested)
authorTony Cook <tony@develop=help.com>
Sun, 15 Mar 2009 00:17:19 +0000 (00:17 +0000)
committerTony Cook <tony@develop=help.com>
Sun, 15 Mar 2009 00:17:19 +0000 (00:17 +0000)
t/05_pfork.t [new file with mode: 0644]

diff --git a/t/05_pfork.t b/t/05_pfork.t
new file mode 100644 (file)
index 0000000..fc2993e
--- /dev/null
@@ -0,0 +1,24 @@
+#!perl -w
+use strict;
+use Test::More;
+use POE::XS::Queue::Array;
+use Config;
+
+$^O eq 'MSWin32'
+  or plan skip_all => "You probably have a sane fork(), not testing";
+
+$Config{useithreads} && $Config{useithreads} eq 'define'
+  or plan skip_all => "No ithreads to support pseudo-fork";
+
+plan tests => 2;
+
+{
+  my $q1 = POE::XS::Queue::Array->new;
+  $q1->enqueue(100, 101);
+  if (!fork) {
+    # child
+    is($q1, undef, "queue object should be magically undef");
+    exit;
+  }
+  isa_ok($q1, "POE::XS::Queue::Array", "parent should still have an object");
+}