From: Darren Chamberlain Date: Fri, 17 Oct 2003 22:17:18 +0000 (+0000) Subject: sqlt-diff test (very basic) X-Git-Tag: v0.04~43 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ed6f968ad762ce9a41863f27c0c37f1b13ec8248;p=dbsrgits%2FSQL-Translator.git sqlt-diff test (very basic) --- diff --git a/t/30sqlt-diff.t b/t/30sqlt-diff.t new file mode 100644 index 0000000..ca459a1 --- /dev/null +++ b/t/30sqlt-diff.t @@ -0,0 +1,35 @@ +#!/usr/bin/perl +# vim: set ft=perl: + +use strict; + +use File::Spec::Functions qw(catfile updir tmpdir); +use File::Temp qw(tempfile); +use FindBin qw($Bin); +use Test::More; + +my @script = qw(blib script sqlt-diff); +my @create1 = qw(data sqlite create.sql); +my @create2 = qw(data sqlite create2.sql); + +my $sqlt_diff = (-d "blib") + ? catfile($Bin, updir, @script) + : catfile($Bin, @script); + +my $create1 = (-d "t") + ? catfile($Bin, @create1) + : catfile($Bin, "t", @create1); + +my $create2 = (-d "t") + ? catfile($Bin, @create2) + : catfile($Bin, "t", @create2); + +plan tests => 2; + +ok(-e $sqlt_diff); +my @cmd = ($sqlt_diff, "$create1=SQLite", "$create2=SQLite"); + +close STDERR; +my $out = `@cmd`; + +like($out, qr/ is missing field/, "Detected missing field 'lemon'");