File: 501-get-associations-implicit.t

package info (click to toggle)
libparse-dia-sql-perl 0.31-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 924 kB
  • sloc: perl: 3,865; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 690 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#   $Id: 501-get-associations-implicit.t,v 1.1 2009/03/30 05:39:58 aff Exp $

use warnings;
use strict;

use Data::Dumper;
use Test::More;
use File::Spec::Functions;
use lib catdir qw ( blib lib );

plan tests => 4;

use_ok ('Parse::Dia::SQL');

my $diasql =  Parse::Dia::SQL->new( file => catfile(qw(t data implicit_role.dia)), db => 'db2' );

isa_ok($diasql, q{Parse::Dia::SQL}, q{Expect a Parse::Dia::SQL object});
ok $diasql->convert();

my $association_arrayref = $diasql->get_associations_ref();
my $expected = [ [ 'emp', 'emp_fk_Dept_id', 'dept_id', 'dept', 'id','' ] ];

is_deeply($association_arrayref, $expected)
  or diag Dumper ($association_arrayref);
undef $diasql;

__END__