forked from schacon/perl
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor croak.t to be data driven (like warnings.t)
- Loading branch information
Showing
5 changed files
with
46 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,20 +1,7 @@ | |||
#!./perl | #!./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'; | ||
chdir 't' if -d 't'; | @INC = '../lib'; | ||
@INC = '../lib'; | |||
require './test.pl'; | |||
plan( tests => 1 ); | |||
} | |||
|
|
||
use strict; | $FATAL = 1; # we expect all the tests to croak | ||
|
require "../t/lib/common.pl"; | ||
fresh_perl_is(<<'EOF', 'No such hook: _HUNGRY at - line 1.', {}, 'Perl_magic_setsig'); | |||
$SIG{_HUNGRY} = \&mmm_pie; | |||
warn "Mmm, pie"; | |||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,7 @@ | |||
__END__ | |||
# mg.c | |||
# NAME Perl_magic_setsig | |||
$SIG{_HUNGRY} = \&mmm_pie; | |||
warn "Mmm, pie"; | |||
EXPECT | |||
No such hook: _HUNGRY at - line 2. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters