Convert-Pheno
view release on metacpan or search on metacpan
lib/Convert/Pheno/Utils/Default.pm view on Meta::CPAN
{ low => -1, high => -1, unit => $DEFAULT{ontology_term} };
$DEFAULT{quantity} = {
unit => $DEFAULT{ontology_term},
value => $DEFAULT{value},
referenceRange => $DEFAULT{referenceRange}
};
# Lock the hash recursively to make it read-only
lock_hash_recurse(%DEFAULT);
# Function to get a reference to the locked default values
sub get_defaults {
return \%DEFAULT;
}
1;
t/29-atomic-output.t view on Meta::CPAN
write_atomically(
$target,
sub {
my ($staged) = @_;
path($staged)->spew_raw("new output\n");
}
);
is( path($target)->slurp_raw, "new output\n", 'successful writes replace existing output' );
is( ( stat $target )[2] & 07777, 0640, 'successful replacement preserves existing permissions' );
my $staged = create_staged_path( catfile( $tmpdir, 'blocked.json' ) );
path($staged)->spew_raw("staged output\n");
throws_ok(
sub { commit_staged_path( $staged, $tmpdir ) },
qr/Could not replace output/,
'a failed portable rename reports the target error',
);
ok( -f $staged, 'a failed direct commit leaves the staged file recoverable' );
ok( discard_staged_path($staged), 'the caller can discard a failed staged commit' );
throws_ok(
( run in 2.158 seconds using v1.01-cache-2.11-cpan-800906f7e73 )