Bit size can range from 1 to 64, test added for size greater than one
[dbsrgits/SQL-Translator.git] / t / 09sqlt-diagram.t
1 use strict;
2 use warnings;
3
4 use File::Spec::Functions qw(catfile updir tmpdir);
5 use File::Temp qw(mktemp);
6 use FindBin qw($Bin);
7 use Test::More;
8 use Test::SQL::Translator qw(maybe_plan);
9
10 BEGIN {
11     maybe_plan(
12         3,
13         'SQL::Translator::Parser::MySQL',
14         'SQL::Translator::Producer::Diagram',
15         'Graph::Directed',
16     );
17 }
18
19 my @script = qw(script sqlt-diagram);
20 my @data = qw(data mysql Apache-Session-MySQL.sql);
21
22 my $sqlt_diagram = catfile($Bin, updir, @script);
23 my $test_data = catfile($Bin, @data);
24
25 my $tmp = mktemp('sqlXXXXX');
26
27 ok(-e $sqlt_diagram);
28 my @cmd = ($^X, $sqlt_diagram, "-d", "MySQL", "-o", $tmp, $test_data);
29 eval { system(@cmd); };
30 ok(!$@ && ($? == 0));
31 ok(-e $tmp);
32 eval { unlink $tmp; };