DataStore-CAS

 view release on metacpan or  search on metacpan

t/10-store-virtual.t  view on Meta::CPAN

#! /usr/bin/env perl -T
use strict;
use warnings;
use Test::More;
use Try::Tiny;
use Path::Class;
use Data::Dumper;
use File::stat;

sub dies(&$) {
	my ($code, $comment)= @_;
	try {
		&$code;
		fail "Failed to die during '$comment'";
	}
	catch {
		ok "died - $comment";
	};
}
sub dies_like(&$$) {
	my ($code, $pattern, $comment)= @_;
	try {
		&$code;
		fail "Failed to die during '$comment'";
	}
	catch {
		like($_, $pattern, $comment);
	};
}

t/11-store-simple.t  view on Meta::CPAN

sub slurp {
	my $f= shift;
	if (ref $f ne 'GLOB') {
		open(my $handle, '<:raw', $f) or do { diag "open($_[0]): $!"; return undef; };
		$f= $handle;
	}
	local $/= undef;
	my $x= <$f>;
	return $x;
}
sub dies(&$) {
	my ($code, $comment)= @_;
	try {
		&$code;
		fail "Failed to die during '$comment'";
	}
	catch {
		ok "died - $comment";
	};
}
sub dies_like(&$$) {
	my ($code, $pattern, $comment)= @_;
	try {
		&$code;
		fail "Failed to die during '$comment'";
	}
	catch {
		like($_, $pattern, $comment);
	};
}



( run in 0.942 second using v1.01-cache-2.11-cpan-49f99fa48dc )