Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-184/Don't skip shared boolean tests when they should be run #185

Merged
merged 2 commits into from Sep 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 9 additions & 3 deletions t/125_shared_boolean.t
Expand Up @@ -5,14 +5,20 @@ use Cpanel::JSON::XS ();

BEGIN {
plan skip_all => 'no threads' if !$Config{usethreads};
eval "require threads::shared 1.21;";
plan skip_all => 'no shared_clone' if $@;
plan tests => 8;
}

use threads;
use threads::shared;

BEGIN {
if (eval {threads::shared->VERSION('1.21')}) {
plan tests => 8;
}
else {
plan skip_all => 'no shared_clone';
}
}

my $json1 = shared_clone({'enabled' => Cpanel::JSON::XS::true});
is( Cpanel::JSON::XS::encode_json( $json1 ), '{"enabled":true}', "Cpanel::JSON::XS shared true");
my $json2 = shared_clone({'disabled' => Cpanel::JSON::XS::false});
Expand Down