Skip to content

Commit 83ce7fe

Browse files
committed
More unit test for attributes across thread clone
1 parent 9d02bfd commit 83ce7fe

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

ext/XS-APItest/t/lexicalattributes.t

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use v5.40;
22

33
use Test::More;
44
use XS::APItest;
5+
use Config ();
56

67
our %ATTRIBUTES_APPLIED;
78

@@ -53,4 +54,13 @@ BEGIN {
5354
':red attribute applied to lexical hash' );
5455
}
5556
57+
# Attribute definitions survive thread cloning
58+
# (this is mostly a test of the underlying SVt_INTERNAL implementation)
59+
SKIP: {
60+
last SKIP unless $Config::Config{usethreads};
61+
62+
require threads;
63+
threads->create( sub { return 123 } )->join;
64+
}
65+
5666
done_testing;

0 commit comments

Comments
 (0)