From: Ash Berlin Date: Wed, 7 Feb 2007 15:49:20 +0000 (+0000) Subject: Sanitised layout - now to start hacking X-Git-Tag: v1.70~282 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=41751122477eb5028a8849fe38ed59bf33fd522f;p=dbsrgits%2FSQL-Abstract.git Sanitised layout - now to start hacking --- diff --git a/pod/Changes.pod b/Changes similarity index 90% rename from pod/Changes.pod rename to Changes index dfc62c2..9655aab 100644 --- a/pod/Changes.pod +++ b/Changes @@ -1,15 +1,5 @@ +Revision history for SQL::Abstract -RCS file: /home/nwiger/perlmod/lib/SQL/RCS/Abstract.pm,v -Working file: /home/nwiger/perlmod/lib/SQL/Abstract.pm -head: 1.20 -branch: -locks: strict -access list: -symbolic names: -keyword substitution: kv -total revisions: 20; selected revisions: 20 -description: -SQL::Abstract - Generate SQL from Perl data structures ---------------------------- revision 1.20 date: 2005/08/18 18:41:58; author: nwiger; state: Exp; lines: +104 -50 @@ -97,4 +87,3 @@ added scalar ref for SQL verbatim in where, fixed bugs, array ref, docs revision 1.1 date: 2001/10/24 00:26:43; author: nwiger; state: Exp; Initial revision -============================================================================= diff --git a/pod/INSTALL.pod b/INSTALL similarity index 100% rename from pod/INSTALL.pod rename to INSTALL diff --git a/make/Makefile.PL b/Makefile.PL similarity index 100% rename from make/Makefile.PL rename to Makefile.PL diff --git a/t/00new.t b/t/00new.t index 1952f94..b90dc8a 100755 --- a/t/00new.t +++ b/t/00new.t @@ -1,14 +1,13 @@ -#!/usr/bin/perl -I. -w +#!/usr/bin/perl use strict; -use vars qw($TESTING); -$TESTING = 1; -use Test; +use warnings; +use Test::More; -# use a BEGIN block so we print our plan before SQL::Abstract is loaded -BEGIN { plan tests => 14 } -use SQL::Abstract; +plan tests => 15; + +use_ok('SQL::Abstract'); my @handle_tests = ( #1 @@ -93,11 +92,7 @@ for (@handle_tests) { my $sql = SQL::Abstract->new($_->{args}); my $bind = $_->{bind} || { a => 4, b => 0}; my($stmt, @bind) = $sql->select('test', '*', $bind); - ok($stmt eq $_->{stmt} && @bind) or - warn "got\n", - "[$stmt], [@bind]\n", - "instead of\n", - "[$_->{stmt}] [4, 0]\n\n"; + ok($stmt eq $_->{stmt} && @bind); } diff --git a/t/01generate.t b/t/01generate.t index e6e55e6..33d9062 100755 --- a/t/01generate.t +++ b/t/01generate.t @@ -1,12 +1,11 @@ -#!/usr/bin/perl -I. -w +#!/usr/bin/perl use strict; -use vars qw($TESTING); -$TESTING = 1; -use Test; +use warnings; +use Test::More; -# use a BEGIN block so we print our plan before SQL::Abstract is loaded -BEGIN { plan tests => 60 } + +plan tests => 60; use SQL::Abstract; diff --git a/t/02where.t b/t/02where.t index 0cfbe49..03fbdc7 100755 --- a/t/02where.t +++ b/t/02where.t @@ -1,13 +1,10 @@ -#!/usr/bin/perl -I. -w +#!/usr/bin/perl use strict; -use vars qw($TESTING); -$TESTING = 1; -use Test; +use warnings; +use Test::More; -# use a BEGIN block so we print our plan before SQL::Abstract is loaded -# we run each test TWICE to make sure _anoncopy is working -BEGIN { plan tests => 24 } +plan tests => 24; use SQL::Abstract; diff --git a/t/03values.t b/t/03values.t index 0c96caa..3730b7f 100755 --- a/t/03values.t +++ b/t/03values.t @@ -1,12 +1,11 @@ -#!/usr/bin/perl -I. -w +#!/usr/bin/perl use strict; -use vars qw($TESTING); -$TESTING = 1; -use Test; +use warnings; +use Test::More; -# use a BEGIN block so we print our plan before SQL::Abstract is loaded -BEGIN { plan tests => 5 } + +plan tests => 5; use SQL::Abstract; diff --git a/t/04from.t b/t/04from.t index 293589a..5e702b5 100644 --- a/t/04from.t +++ b/t/04from.t @@ -1,12 +1,11 @@ -#!/usr/bin/perl -I. -w +#!/usr/bin/perl use strict; -use vars qw($TESTING); -$TESTING = 1; -use Test; +use warnings; +use Test::More; -# use a BEGIN block so we print our plan before SQL::Abstract is loaded -BEGIN { plan tests => 4 } + +plan tests => 4; use SQL::Abstract; diff --git a/t/05quotes.t b/t/05quotes.t index 105ee94..af40887 100644 --- a/t/05quotes.t +++ b/t/05quotes.t @@ -3,19 +3,13 @@ use warnings; use vars qw($TESTING); $TESTING = 1; -use Test; +use Test::More; # use a BEGIN block so we print our plan before SQL::Abstract is loaded -BEGIN { plan tests => 4 } +BEGIN { plan tests => 7 } use SQL::Abstract; -sub is { - my ($got, $expect, $msg) = @_; - ok($got eq $expect) or - warn "got [${got}]\ninstead of [${expect}]\nfor test ${msg}\n\n"; -} - my $sql_maker = SQL::Abstract->new; $sql_maker->{quote_char} = '`'; @@ -75,13 +69,16 @@ is($sql, undef ); -#TODO: { -# local $TODO = "order_by with quoting needs fixing (ash/castaway)"; -# -# is($sql, -# q/SELECT `me`.`cdid`, `me`.`artist`, `me`.`title`, `me`.`year` FROM `cd` `me` ORDER BY `year` DESC/, -# 'quoted ORDER BY with DESC okay'); -#} + + +TODO: { + local $TODO = "order_by with quoting needs fixing (ash/castaway)"; + + is($sql, + q/SELECT `me`.`cdid`, `me`.`artist`, `me`.`title`, `me`.`year` FROM `cd` `me` ORDER BY `year` DESC/, + 'quoted ORDER BY with DESC okay'); +} + ($sql,) = $sql_maker->select( [