Bugzilla – Attachment 36891 Details for
Bug 13814
Add unit tests for C4::Boolean
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13814: (QA followup) test for generated warnings
Bug-13814-QA-followup-test-for-generated-warnings.patch (text/plain), 1.82 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-03-15 12:05:22 UTC
(
hide
)
Description:
Bug 13814: (QA followup) test for generated warnings
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-03-15 12:05:22 UTC
Size:
1.82 KB
patch
obsolete
>From a3775ceccddb4aea8393ea1eb76f16d4bf304151 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Sun, 15 Mar 2015 09:03:33 -0300 >Subject: [PATCH] Bug 13814: (QA followup) test for generated warnings > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > t/Boolean.t | 24 ++++++++++++++++++------ > 1 file changed, 18 insertions(+), 6 deletions(-) > >diff --git a/t/Boolean.t b/t/Boolean.t >index b82068c..7ca05f1 100755 >--- a/t/Boolean.t >+++ b/t/Boolean.t >@@ -1,8 +1,8 @@ > >-use strict; >-use warnings; >+use Modern::Perl; > >-use Test::More tests => 19; >+use Test::More tests => 22; >+use Test::Warn; > > BEGIN { use_ok( 'C4::Boolean', qw( true_p ) ); } > >@@ -23,6 +23,18 @@ is( true_p('yes'), '1', 'recognizes \'yes\' as true' ); > is( true_p('y'), '1', 'recognizes \'y\' as true' ); > is( true_p('YES'), '1', 'verified case insensitivity' ); > >-is( true_p(undef), undef, 'recognizes undefined as not boolean' ); >-is( true_p('foo'), undef, 'recognizes \'foo\' as not boolean' ); >-is( true_p([]), undef, 'recognizes a reference as not a boolean' ); >+my $result; >+warning_like { $result = true_p(undef) } >+ qr/^The given value does not seem to be interpretable as a Boolean value/, >+ 'Invalid boolean (undef) raises warning'; >+is( $result, undef, 'recognizes undefined as not boolean' ); >+warning_like { $result = true_p('foo') } >+ qr/^The given value does not seem to be interpretable as a Boolean value/, >+ 'Invalid boolean (\'foo\') raises warning'; >+is( $result, undef, 'recognizes \'foo\' as not boolean' ); >+warning_like { $result = true_p([]) } >+ qr/^The given value does not seem to be interpretable as a Boolean value/, >+ 'Invalid boolean (reference) raises warning'; >+is( $result, undef, 'recognizes a reference as not a boolean' ); >+ >+1; >-- >2.3.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13814
:
36758
|
36765
|
36771
|
36773
|
36774
|
36868
|
36869
| 36891