This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Convert two ok()s to better constructions.
authorNicholas Clark <nick@ccl4.org>
Thu, 20 Apr 2006 17:37:31 +0000 (17:37 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 20 Apr 2006 17:37:31 +0000 (17:37 +0000)
p4raw-id: //depot/perl@27918

lib/base/t/fields.t

index f36fc82..049b29d 100644 (file)
@@ -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);
     }
 }