]> git.vpit.fr Git - perl/modules/Lexical-Types.git/commitdiff
Test for the base package name correctness in threads
authorVincent Pit <vince@profvince.com>
Wed, 25 Feb 2009 10:40:45 +0000 (11:40 +0100)
committerVincent Pit <vince@profvince.com>
Wed, 25 Feb 2009 10:40:45 +0000 (11:40 +0100)
t/30-threads.t

index d3dcc3b644b8d29d471bf1ca123681635df70002..32bdf8039ae3205f903d791496204cd65c05ad05 100644 (file)
@@ -15,12 +15,18 @@ BEGIN {
 
 use threads;
 
-use Test::More tests => 10 * 2;
+use Test::More tests => 10 * 2 * (1 + 2);
 
 {
  package Lexical::Types::Test::Tag;
 
- sub TYPEDSCALAR { $_[1] = threads->tid() }
+ sub TYPEDSCALAR {
+  my $tid = threads->tid();
+  Test::More::is($_[0], __PACKAGE__, "base type is correct in thread $tid");
+  Test::More::is($_[2], 'Tag', "original type is correct in thread $tid");
+  $_[1] = $tid;
+  ();
+ }
 }
 
 { package Tag; }