summaryrefslogtreecommitdiff
path: root/t/lib/croak.t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-05-20 13:00:37 +0200
committerNicholas Clark <nick@ccl4.org>2009-05-20 13:00:37 +0200
commit4b63d99d508dbe4b46146e3520549a6ad23a121b (patch)
tree2c559387f26f2eea3685886dfc10fa5421a849fe /t/lib/croak.t
parent477af4ed3f54f710ff1df4f1f2440995829f50bf (diff)
downloadperl-4b63d99d508dbe4b46146e3520549a6ad23a121b.tar.gz
Tests for calls to Perl_croak() in the C source. Starting with "No such hook".
Diffstat (limited to 't/lib/croak.t')
-rwxr-xr-xt/lib/croak.t20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/lib/croak.t b/t/lib/croak.t
new file mode 100755
index 0000000000..6a9b405a54
--- /dev/null
+++ b/t/lib/croak.t
@@ -0,0 +1,20 @@
+#!./perl
+# So far, it seems, there is no place to test all the Perl_croak() calls in the
+# C code. So this is a start. It's likely that it needs refactoring to be data
+# driven. Data driven code exists in various other tests - best plan would be to
+# investigate whether any common code library already exists, and if not,
+# refactor the "donor" test code into a common code library.
+
+BEGIN {
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require './test.pl';
+ plan( tests => 1 );
+}
+
+use strict;
+
+fresh_perl_is(<<'EOF', 'No such hook: _HUNGRY at - line 1.', {}, 'Perl_magic_setsig');
+$SIG{_HUNGRY} = \&mmm_pie;
+warn "Mmm, pie";
+EOF