$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'
);
$pp->query_start('SELECT * FROM frew WHERE id = ?', q('2'));
is(
$cap,
- qq(... : '2'\n\n),
+ qq(... : '2'\n),
'Repeated SQL ellided'
);
$pp->query_start('SELECT * FROM frew WHERE id = ?', q('3'));
is(
$cap,
- qq(... : '3'\n\n),
+ qq(... : '3'\n),
'Repeated SQL ellided'
);
$pp->query_start('SELECT * FROM frew WHERE id = ?', q('4'));
is(
$cap,
- qq(... : '4'\n\n),
+ qq(... : '4'\n),
'Repeated SQL ellided'
);
$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'
);
$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'
);
--- /dev/null
+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;