X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F021-weak-ref.t;h=cdafd3c2cd0da7a2e7d5c647d51ef96ce306cdaf;hb=ab1a1cce52104e19f86fec43e8ffa9f008041ee5;hp=2276724be8539831f1a7b1203accccbfbff6be0e;hpb=3645b3164ce4e4fafa8ee65c515281175da0efe7;p=gitmo%2FMouse.git diff --git a/t/021-weak-ref.t b/t/021-weak-ref.t index 2276724..cdafd3c 100644 --- a/t/021-weak-ref.t +++ b/t/021-weak-ref.t @@ -1,9 +1,18 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 21; + +use Test::More; +BEGIN { + if (eval "require Scalar::Util; 1") { + plan tests => 21; + } + else { + plan skip_all => "Scalar::Util required for this test"; + } +} + use Test::Exception; -use Scalar::Util 'isweak'; my %destroyed; @@ -35,7 +44,7 @@ do { $self2->self($self3); for my $object ($self, $self2, $self3) { - ok(isweak($object->{self}), "weak reference"); + ok(Scalar::Util::isweak($object->{self}), "weak reference"); ok($object->self->self->self->self, "we've got circularity"); } };