Permalink
Browse files

test for various fatal messages from op.c

  • Loading branch information...
tonycoz committed Nov 28, 2011
1 parent 59e3875 commit 7a44ba35de261d00c7309100a861cb33b4a0152b
Showing with 45 additions and 0 deletions.
  1. +1 −0 MANIFEST
  2. +44 −0 t/lib/croak/op
View
@@ -4974,6 +4974,7 @@ t/lib/common.pl Helper for lib/{warnings,feature}.t
t/lib/commonsense.t See if configuration meets basic needs
t/lib/compmod.pl Helper for 1_compile.t
t/lib/croak/mg Test croak calls from mg.c
+t/lib/croak/op Test croak calls from op.c
t/lib/croak.t Test calls to Perl_croak() in the C source.
t/lib/cygwin.t Builtin cygwin function tests
t/lib/dbmt_common.pl Common functionality for ?DBM_File tests
View
@@ -0,0 +1,44 @@
+__END__
+# NAME OP_HELEM fields
+package Foo;
+use fields qw(a b);
+sub new {
+ my $class = shift;
+ return fields::new($class);
+}
+my Foo $f = Foo->new;
+$f->{c} = 1;
+EXPECT
+No such class field "c" in variable $f of type Foo at - line 8.
+########
+# NAME OP_HSLICE fields
+package Foo;
+use fields qw(a b);
+sub new {
+ my $class = shift;
+ return fields::new($class);
+}
+my Foo $f = Foo->new;
+@$f{"a", "c"} = ( 1, 2 );
+EXPECT
+No such class field "c" in variable $f of type Foo at - line 8.
+########
+# NAME my sub
+my sub foo { }
+EXPECT
+"my sub" not yet implemented at - line 1.
+########
+# NAME delete BAD
+delete $x;
+EXPECT
+delete argument is not a HASH or ARRAY element or slice at - line 1.
+########
+# NAME exists BAD
+exists $x;
+EXPECT
+exists argument is not a HASH or ARRAY element or a subroutine at - line 1.
+########
+# NAME exists non-sub
+exists &foo()
+EXPECT
+exists argument is not a subroutine name at - line 1.

0 comments on commit 7a44ba3

Please sign in to comment.