From: Shawn M Moore Date: Sun, 28 Sep 2008 04:00:56 +0000 (+0000) Subject: Skip t/021-weak-ref if we don't have Scalar::Util X-Git-Tag: 0.19~210 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cacfab6c945428bc514d03d53c1ca7a499b1de2a;p=gitmo%2FMouse.git Skip t/021-weak-ref if we don't have Scalar::Util --- 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"); } };