Bugzilla – Attachment 39616 Details for
Bug 14116
Silence noise t/Scrubber.t
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14116: Clean up output, not just noise.
Bug-14116-Clean-up-output-not-just-noise.patch (text/plain), 3.23 KB, created by
Mark Tompsett
on 2015-05-27 18:11:30 UTC
(
hide
)
Description:
Bug 14116: Clean up output, not just noise.
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-05-27 18:11:30 UTC
Size:
3.23 KB
patch
obsolete
>From 906cd3eeb7ca2d6233865e3fa8db3396413eb4e7 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Sat, 23 May 2015 00:17:00 -0400 >Subject: [PATCH] Bug 14116: Clean up output, not just noise. > >--- > t/Scrubber.t | 46 +++++++++++++++++++++------------------------- > 1 file changed, 21 insertions(+), 25 deletions(-) > >diff --git a/t/Scrubber.t b/t/Scrubber.t >index 08642fe..9bcd003 100755 >--- a/t/Scrubber.t >+++ b/t/Scrubber.t >@@ -3,7 +3,10 @@ > use strict; > use warnings; > >-use Test::More tests => 19; >+$| = 1; >+use Test::More tests => 29; >+use Test::Warn; >+ > BEGIN { > use FindBin; > use lib $FindBin::Bin; >@@ -43,46 +46,39 @@ $html = q| > At the end here, I actually have some regular text. > |; > >-print pretty_line("Original HTML:"), $html, "\n", pretty_line(); >-$collapse and print "Note: scrubber test output will have whitespace collapsed for readability\n"; > ok($scrubber = C4::Scrubber->new(), "Constructor: C4::Scrubber->new()"); > > isa_ok($scrubber, 'HTML::Scrubber', 'Constructor returns HTML::Scrubber object'); > >-ok(printf("# scrubber settings: default %s, comment %s, process %s\n", >- $scrubber->default(),$scrubber->comment(),$scrubber->process()), >- "Outputting settings from scrubber object (type: [default])" >-); >+warning_like { $scrubber->default() } '', "\$scrubber->default ran without fault."; >+warning_like { $scrubber->comment() } '', "\$scrubber->comment ran without fault."; >+warning_like { $scrubber->process() } '', "\$scrubber->process ran without fault."; >+ > ok($result = $scrubber->scrub($html), "Getting scrubbed text (type: [default])"); >-$collapse and $result =~ s/\s*\n\s*/\n/g; >-print pretty_line('default'), $result, "\n", pretty_line(); > > foreach(@types) { > ok($scrubber = C4::Scrubber->new($_), "testing Constructor: C4::Scrubber->new($_)"); >- ok(printf("# scrubber settings: default %s, comment %s, process %s\n", >- $scrubber->default(),$scrubber->comment(),$scrubber->process()), >- "Outputting settings from scrubber object (type: $_)" >- ); >+ >+ warning_like { $scrubber->default() } '', "\$scrubber->default ran without fault."; >+ warning_like { $scrubber->comment() } '', "\$scrubber->comment ran without fault."; >+ warning_like { $scrubber->process() } '', "\$scrubber->process ran without fault."; >+ > ok($result = $scrubber->scrub($html), "Getting scrubbed text (type: $_)"); >- $collapse and $result =~ s/\s*\n\s*/\n/g; >- print pretty_line($_), $result, "\n", pretty_line(); > } > >-print "\n\n######################################################\nStart of invalid tests\n"; >- > #Test for invalid new entry > eval{ > C4::Scrubber->new(""); >- fail("test should fail on entry of ''\n"); >+ fail("test should fail on entry of ''"); > }; >-pass("Test should have failed on entry of '' (empty string) and it did. YAY!\n"); >+if ($@) { >+ pass("Test should have failed on entry of '' (empty string) and it did. YAY!"); >+} > > eval{ > C4::Scrubber->new("Client"); >- fail("test should fail on entry of 'Client'\n"); >+ fail("test should fail on entry of 'Client'"); > }; >-pass("Test should have failed on entry of 'Client' and it did. YAY!\n"); >- >-print "######################################################\n"; >- >-print "done.\n"; >+if ($@) { >+ pass("Test should have failed on entry of 'Client' and it did. YAY!"); >+} >-- >2.1.4
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 14116
:
38757
|
38906
|
39615
|
39616
|
39617
|
39619
|
39694