summaryrefslogtreecommitdiff
path: root/t/43-dbtest.t
diff options
context:
space:
mode:
Diffstat (limited to 't/43-dbtest.t')
-rw-r--r--t/43-dbtest.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/43-dbtest.t b/t/43-dbtest.t
new file mode 100644
index 00000000..d19ab215
--- /dev/null
+++ b/t/43-dbtest.t
@@ -0,0 +1,24 @@
+use Test::More;
+use strict;
+
+if (!defined $ENV{PGDATABASE}){
+ plan skip_all => 'PGDATABASE Environment Variable not set up';
+}
+else {
+ plan tests => 50;
+}
+
+my @testscripts = qw(Account Business_type Company Draft Payment
+ Session Voucher);
+
+chdir 'sql/modules/test/';
+
+for my $testscript (@testscripts){
+ open (TEST, '-|', "psql -f $testscript.sql");
+ my @testlines = grep /\|\s+(t|f)\s?$/, <TEST>;
+ cmp_ok(scalar @testlines, '>', 0, "$testscript.sql returned test results");
+ for my $test (@testlines){
+ my @parts = split /\|/, $test;
+ like($parts[1], qr/t/, $parts[0]);
+ }
+}