-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
Data::Dumper::qquote()
Fast Exit Tests
- Loading branch information
1 parent
ef8a989
commit c9ba999
Showing
2 changed files
with
83 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
#!./perl -w | ||
# t/seen.t - Test Seen() | ||
|
||
use strict; | ||
use warnings; | ||
|
||
#use lib qw( . ); | ||
#use Dumper; | ||
use Test::More tests => 16; | ||
#use lib qw( ./t/lib ); | ||
|
||
{ | ||
my $warning = ''; | ||
local $SIG{__WARN__} = sub { $warning = $_[0] }; | ||
|
||
my $str = Data::Dumper::qquote(""); | ||
is($str, q{""}, q{qquote("") returned ""}); | ||
is($warning, "", q{qquote("") did not warn}); | ||
} | ||
|
||
{ | ||
my $warning = ''; | ||
local $SIG{__WARN__} = sub { $warning = $_[0] }; | ||
|
||
my $str = Data::Dumper::qquote(); | ||
is($str, q{""}, q{qquote() returned ""}); | ||
is($warning, "", q{qquote() did not warn}); | ||
} | ||
|
||
{ | ||
my $warning = ''; | ||
local $SIG{__WARN__} = sub { $warning = $_[0] }; | ||
|
||
my $str = Data::Dumper::qquote(undef); | ||
is($str, q{""}, q{qquote(undef) returned ""}); | ||
is($warning, "", q{qquote(undef) did not warn}); | ||
} | ||
|
||
{ | ||
my $warning = ''; | ||
local $SIG{__WARN__} = sub { $warning = $_[0] }; | ||
|
||
my $str = Data::Dumper::qquote("simple"); | ||
is($str, q{"simple"}, q{qquote("simple") returned "simple"}); | ||
is($warning, "", q{qquote("simple") did not warn}); | ||
} | ||
|
||
{ | ||
my $warning = ''; | ||
local $SIG{__WARN__} = sub { $warning = $_[0] }; | ||
|
||
my $str = Data::Dumper::qquote(q{check 'single' quote}); | ||
is($str, q{"check 'single' quote"}, q{qquote('single') returned correctly}); | ||
is($warning, "", q{qquote('single') did not warn}); | ||
} | ||
|
||
{ | ||
my $warning = ''; | ||
local $SIG{__WARN__} = sub { $warning = $_[0] }; | ||
|
||
my $str = Data::Dumper::qquote(q{check "double" quote}); | ||
is($str, q{"check \"double\" quote"}, q{qquote("double") returned correctly}); | ||
is($warning, "", 'qquote(undef) did not warn'); | ||
} | ||
|
||
{ | ||
my $warning = ''; | ||
local $SIG{__WARN__} = sub { $warning = $_[0] }; | ||
|
||
my $str = Data::Dumper::qquote(qq{check \a quote}); | ||
is($str, q{"check \a quote"}, q{qquote("\a") returned correctly}); | ||
is($warning, "", 'qquote(undef) did not warn'); | ||
} | ||
|
||
{ | ||
my $warning = ''; | ||
local $SIG{__WARN__} = sub { $warning = $_[0] }; | ||
|
||
my $str = Data::Dumper::qquote(qq{check \cg quote}); | ||
is($str, q{"check \a quote"}, q{qquote("\cg") returned correctly}); | ||
is($warning, "", 'qquote(undef) did not warn'); | ||
} |