Skip to content

Commit

Permalink
fix deprecated code
Browse files Browse the repository at this point in the history
  • Loading branch information
cjfields committed May 30, 2015
1 parent 995168b commit 2be83c3
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion t/PrimarySeq.t
Expand Up @@ -4,7 +4,7 @@ use Test;

use lib './lib';

eval_lives_ok 'use Bio::PrimarySeq', 'Can use Bio::PrimarySeq';
eval-lives-ok 'use Bio::PrimarySeq', 'Can use Bio::PrimarySeq';

use Bio::PrimarySeq;

Expand Down
2 changes: 1 addition & 1 deletion t/Range.t
Expand Up @@ -70,7 +70,7 @@ for @spans -> $s {
}

ok(@ranges[0] ~~ Bio::Role::Range, 'Range role');
isa_ok(@ranges[0], MyRange, 'MyRange class');
isa-ok(@ranges[0], MyRange, 'MyRange class');
ok(!@ranges[0].^isa(Bio::Role::Range), 'Role consumed by class');
is(@ranges[0].start, 1);
is(@ranges[0].end, 100);
Expand Down
2 changes: 1 addition & 1 deletion t/Role/IO.t
Expand Up @@ -19,7 +19,7 @@ my $in = MyIO.new( file => $*SPEC.catfile('t','data','test.fasta'), :r);
ok($in ~~ Bio::Role::IO, 'does Bio::Role::IO');
is($in.file, $*SPEC.catfile('t','data','test.fasta')); # De-UNIX this

isa_ok($in.fh, 'IO::Handle');
isa-ok($in.fh, 'IO::Handle');

todo('Mode NYI', 1);
is($in.mode, 'r');
Expand Down
10 changes: 5 additions & 5 deletions t/Role/Temp.t
Expand Up @@ -27,15 +27,15 @@ my ($tfh,$tfile);
{
ok my $obj = MyTemp.new();

isa_ok $obj, 'MyTemp';
isa-ok $obj, 'MyTemp';

ok $obj ~~ Bio::Role::Temp;

my $TEST_STRING = "Bioperl rocks!\n";
($tfile, $tfh) = $obj.tmpfile();

# check write
isa_ok $tfh, 'IO::Handle';
isa-ok $tfh, 'IO::Handle';
$tfh.print($TEST_STRING);
$tfh.close;

Expand Down Expand Up @@ -76,7 +76,7 @@ my ($tfh,$tfile);
{
my $obj = MyTemp.new();
($tfile, $tfh) = $obj.tmpfile(:!unlink);
isa_ok $tfh, 'IO::Handle';
isa-ok $tfh, 'IO::Handle';
$tfh.close;
ok $tfile.IO ~~ :e, ':e' ;
$obj = Nil;
Expand All @@ -91,14 +91,14 @@ my ($tfh,$tfile);

# check suffix is applied
my ($tfile, $tfh) = $obj.tmpfile(:suffix<.bioperl>);
isa_ok $tfh, 'IO::Handle';
isa-ok $tfh, 'IO::Handle';
#like $tfh, rx/\.bioperl$/, 'tempfile suffix';
ok close $tfh;
@cleaned.push: $tfile;

## check single return value mode of File::Temp
#my $fh2 = $obj->tempfile;
#isa_ok $fh2, 'GLOB';
#isa-ok $fh2, 'GLOB';
#ok $fh2, 'tempfile() in scalar context';
#ok close $fh2;
#}
Expand Down
24 changes: 12 additions & 12 deletions t/Root.t
Expand Up @@ -12,16 +12,16 @@ use Bio::Root::Root;
my $s = Bio::Root::Root.new();

ok($s.isa(Bio::Root::Root));
eval_dies_ok('$s.throw("foo")','throw');
lives_ok {$s.warn("foo")},'warn() does not die';
eval-dies-ok('$s.throw("foo")','throw');
lives-ok {$s.warn("foo")},'warn() does not die';
$s.warn("foo");
lives_ok {$s.debug("foo"),'debug() does not die'};
lives-ok {$s.debug("foo"),'debug() does not die'};

# test strictness
$s.strict = 2; # convert warn to throw
eval_dies_ok('$s.throw("foo")');
eval_dies_ok('$s.warn("foo")');
lives_ok {$s.debug("foo")};
eval-dies-ok('$s.throw("foo")');
eval-dies-ok('$s.warn("foo")');
lives-ok {$s.debug("foo")};

# check inheritance
class Foo is Bio::Root::Root {};
Expand All @@ -30,12 +30,12 @@ my $n = Foo.new();

ok($n.isa(Foo));
ok($n.isa(Bio::Root::Root));
eval_dies_ok('$n.throw("foo")');
lives_ok {$n.warn("foo")};
lives_ok {$n.debug("foo")};
eval-dies-ok('$n.throw("foo")');
lives-ok {$n.warn("foo")};
lives-ok {$n.debug("foo")};
$s.strict = 2; # convert warn to throw
eval_dies_ok('$n.throw("foo")');
eval_dies_ok('$n.warn("foo")');
lives_ok {$n.debug("foo")};
eval-dies-ok('$n.throw("foo")');
eval-dies-ok('$n.warn("foo")');
lives-ok {$n.debug("foo")};

done();
8 changes: 4 additions & 4 deletions t/SeqIO.t
Expand Up @@ -12,7 +12,7 @@ my $in = Bio::SeqIO.new(format => 'fasta');

is($in.format, 'fasta', 'format');

dies_ok { $in.format = 'fastq' }, 'readonly';
dies-ok { $in.format = 'fastq' }, 'readonly';

# no version or variant (these are optional)
ok($in.format-version ~~ Any, 'version');
Expand All @@ -25,8 +25,8 @@ $in = Bio::SeqIO.new(format => 'fasta',

is($in.format, 'fasta', 'format');
is($in.format-version, 1.0, 'version');
dies_ok { $in.format-version = 2.0 }, 'readonly';
dies_ok { $in.format-variant = 'new'}, 'readonly';
dies-ok { $in.format-version = 2.0 }, 'readonly';
dies-ok { $in.format-variant = 'new'}, 'readonly';

is($in.format-variant, 'old', 'variant');

Expand All @@ -38,6 +38,6 @@ is($in.format, 'fasta', 'format');
is($in.format-version, 1.0, 'version');
is($in.format-variant, 'old', 'variant');

dies_ok {Bio::SeqIO.new(format => "foo")}, 'dies with an unknown format';
dies-ok {Bio::SeqIO.new(format => "foo")}, 'dies with an unknown format';

done();
16 changes: 8 additions & 8 deletions t/Tools/IUPAC.t
Expand Up @@ -4,8 +4,8 @@ use lib './lib';

use Test;
plan 10;
eval_lives_ok 'use Bio::Tools::IUPAC', 'Can use Bio::Tools::IUPAC';
eval_lives_ok 'use Bio::PrimarySeq', 'Can use Bio::PrimarySeq';
eval-lives-ok 'use Bio::Tools::IUPAC', 'Can use Bio::Tools::IUPAC';
eval-lives-ok 'use Bio::PrimarySeq', 'Can use Bio::PrimarySeq';

use Bio::Tools::IUPAC;
use Bio::PrimarySeq;
Expand Down Expand Up @@ -88,13 +88,13 @@ my $stream = Bio::Tools::IUPAC.new(seq => $ambiseq);
is $stream.count(), 4;

#this is pretty useless but still test it anyway. Probably get rid of this api later
is_deeply($stream.iupac_iub(),%IUB,'Can access IUB hash from method call');
is_deeply($stream.iupac_rev_iub(),%REV_IUB,'Can access REV_IUB hash from method call');
is_deeply($stream.iupac_iup(),%IUP,'Can access IUP hash from method call');
is-deeply($stream.iupac_iub(),%IUB,'Can access IUB hash from method call');
is-deeply($stream.iupac_rev_iub(),%REV_IUB,'Can access REV_IUB hash from method call');
is-deeply($stream.iupac_iup(),%IUP,'Can access IUP hash from method call');

is_deeply(%Bio::Tools::IUPAC::IUB,%IUB,'Can access IUB hash as a class variable');
is_deeply(%Bio::Tools::IUPAC::REV_IUB,%REV_IUB,'Can access REV_IUB hash as a class variable');
is_deeply(%Bio::Tools::IUPAC::IUP,%IUP,'Can access IUP hash as a class variable');
is-deeply(%Bio::Tools::IUPAC::IUB,%IUB,'Can access IUB hash as a class variable');
is-deeply(%Bio::Tools::IUPAC::REV_IUB,%REV_IUB,'Can access REV_IUB hash as a class variable');
is-deeply(%Bio::Tools::IUPAC::IUP,%IUP,'Can access IUP hash as a class variable');

my $b = 1;
while (my $uniqueseq = $stream.next_seq()) {
Expand Down

0 comments on commit 2be83c3

Please sign in to comment.