File: 702-utils-make-name.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 (29 lines) | stat: -rw-r--r-- 957 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
29
#   $Id: 702-utils-make-name.t,v 1.1 2009/02/23 07:36:17 aff Exp $

use warnings;
use strict;

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

plan tests => 9;

use lib q{lib};
use_ok ('Parse::Dia::SQL::Utils');

# Need to specify database for make_name to pass
my $utils = Parse::Dia::SQL::Utils->new( db => 'db2' );
isa_ok($utils, 'Parse::Dia::SQL::Utils');

# make_name
is($utils->make_name(0, qw(One two three)), q{OneTwoThree});
is($utils->make_name(1, qw(one two three)), q{oneTwoThree});
is($utils->make_name(1, qw(student_course _fk_ course course_id)), q{lTeT8iBKfXObJYiSrq});
is($utils->make_name(0, qw(student_course _fk_ course course_id)), q{lTeT8iBKfXObJYiSrq});
is($utils->make_name(0, qw(course course_id)), q{courseCourse_id});
is($utils->make_name(0, qw(course course_id foo)), q{courseCourse_idFoo});
is($utils->make_name(0, qw(course course_id foo bar tze)), q{crsCrs_dFooBarTze});

__END__