From: Nicholas Clark Date: Thu, 20 Apr 2006 17:37:31 +0000 (+0000) Subject: Convert two ok()s to better constructions. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=20cfb7610f01690cff9c14e0b19d9a1a2acf2573;p=p5sagit%2Fp5-mst-13.2.git Convert two ok()s to better constructions. p4raw-id: //depot/perl@27918 --- diff --git a/lib/base/t/fields.t b/lib/base/t/fields.t index f36fc82..049b29d 100644 --- a/lib/base/t/fields.t +++ b/lib/base/t/fields.t @@ -44,7 +44,7 @@ eval q(return; my Foo $obj = Foo->new; $obj->{notthere} = ""); my $error = $Has_PH ? 'No such(?: [\w-]+)? field "notthere"' : q[No such class field "notthere" in variable $obj ]. q[of type Foo]; -ok( $@ && $@ =~ /^\Q$error/i ); +like( $@, qr/^\Q$error/i ); foreach (Foo->new) { @@ -58,7 +58,7 @@ foreach (Foo->new) { @{$obj}{qw(what who _up_yours)} = ('Ahh', 'Moo', 'Yip'); while(my($k,$v) = each %test) { - ok($obj->{$k} eq $v); + is($obj->{$k}, $v); } }