📄 assert.pm
字号:
package Test::Harness::Assert;use strict;require Exporter;use vars qw($VERSION @EXPORT @ISA);$VERSION = '0.02';@ISA = qw(Exporter);@EXPORT = qw(assert);=head1 NAMETest::Harness::Assert - simple assert=head1 SYNOPSIS ### FOR INTERNAL USE ONLY ### use Test::Harness::Assert; assert( EXPR, $name );=head1 DESCRIPTIONA simple assert routine since we don't have Carp::Assert handy.B<For internal use by Test::Harness ONLY!>=head1 FUNCTIONS=head2 C<assert()> assert( EXPR, $name );If the expression is false the program aborts.=cutsub assert ($;$) { my($assert, $name) = @_; unless( $assert ) { require Carp; my $msg = 'Assert failed'; $msg .= " - '$name'" if defined $name; $msg .= '!'; Carp::croak($msg); }}=head1 AUTHORMichael G Schwern C<< <schwern at pobox.com> >>=head1 SEE ALSOL<Carp::Assert>=cut1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -