summaryrefslogtreecommitdiff
path: root/t/master.t
diff options
context:
space:
mode:
Diffstat (limited to 't/master.t')
-rw-r--r--t/master.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/master.t b/t/master.t
new file mode 100644
index 0000000..1529993
--- /dev/null
+++ b/t/master.t
@@ -0,0 +1,16 @@
+#!perl
+use strict;
+use warnings;
+use Test::Most tests => 4, 'die';
+use threads;
+use Thread::Task::Thread ':master';
+
+sleep 0.1;
+is( scalar( threads->list ), 1, 'One thread exists' );
+
+# Fetch the master, is it the existing one?
+my $master1 = Thread::Task::Thread->master;
+my $master2 = Thread::Task::Thread->master;
+isa_ok( $master1, 'Thread::Task::Thread' );
+isa_ok( $master2, 'Thread::Task::Thread' );
+is( $master1->wid, $master2->wid, 'Masters match' );