From: Arthur Axel 'fREW' Schmidt Date: Sun, 24 Oct 2010 21:15:40 +0000 (-0500) Subject: fixup tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=13662f979a4458c63055fbdde32e389e0c6ea577;p=scpubgit%2FQ-Branch.git fixup tests --- diff --git a/t/dbic/no-repeats.t b/t/dbic/no-repeats.t index 1ec4c53..56e4891 100644 --- a/t/dbic/no-repeats.t +++ b/t/dbic/no-repeats.t @@ -20,7 +20,7 @@ $pp->debugfh($fh); $pp->query_start('SELECT * FROM frew WHERE id = ?', q('1')); is( $cap, - qq(SELECT * FROM frew WHERE id = '1'\n\n), + qq(SELECT * FROM frew WHERE id = '1'\n), 'SQL Logged' ); @@ -28,7 +28,7 @@ open $fh, '>', \$cap; $pp->query_start('SELECT * FROM frew WHERE id = ?', q('2')); is( $cap, - qq(... : '2'\n\n), + qq(... : '2'\n), 'Repeated SQL ellided' ); @@ -36,7 +36,7 @@ open $fh, '>', \$cap; $pp->query_start('SELECT * FROM frew WHERE id = ?', q('3')); is( $cap, - qq(... : '3'\n\n), + qq(... : '3'\n), 'Repeated SQL ellided' ); @@ -44,7 +44,7 @@ open $fh, '>', \$cap; $pp->query_start('SELECT * FROM frew WHERE id = ?', q('4')); is( $cap, - qq(... : '4'\n\n), + qq(... : '4'\n), 'Repeated SQL ellided' ); @@ -52,7 +52,7 @@ open $fh, '>', \$cap; $pp->query_start('SELECT * FROM bar WHERE id = ?', q('4')); is( $cap, - qq(SELECT * FROM bar WHERE id = '4'\n\n), + qq(SELECT * FROM bar WHERE id = '4'\n), 'New SQL Logged' ); @@ -60,7 +60,7 @@ open $fh, '>', \$cap; $pp->query_start('SELECT * FROM frew WHERE id = ?', q('1')); is( $cap, - qq(SELECT * FROM frew WHERE id = '1'\n\n), + qq(SELECT * FROM frew WHERE id = '1'\n), 'New SQL Logged' ); diff --git a/t/dbic/show-progress.t b/t/dbic/show-progress.t new file mode 100644 index 0000000..672d635 --- /dev/null +++ b/t/dbic/show-progress.t @@ -0,0 +1,31 @@ +use strict; +use warnings; + +use Test::More; +use DBIx::Class::Storage::Debug::PrettyPrint; + +my $cap; +open my $fh, '>', \$cap; + +my $pp = DBIx::Class::Storage::Debug::PrettyPrint->new({ + show_progress => 1, + clear_line => 'CLEAR', + executing => 'GOGOGO', +}); + +$pp->debugfh($fh); + +$pp->query_start('SELECT * FROM frew WHERE id = 1'); +is( + $cap, + qq(SELECT * FROM frew WHERE id = 1 : \nGOGOGO), + 'SQL Logged' +); +$pp->query_end('SELECT * FROM frew WHERE id = 1'); +is( + $cap, + qq(SELECT * FROM frew WHERE id = 1 : \nGOGOGOCLEAR), + 'SQL Logged' +); + +done_testing;