+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
revision 1.1
date: 2001/10/24 00:26:43; author: nwiger; state: Exp;
Initial revision
-=============================================================================
-#!/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
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);
}
-#!/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;
-#!/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;
-#!/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;
-#!/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;
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} = '`';
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(
[