File: 020-util.t

package info (click to toggle)
libdbix-dr-perl 0.19-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 340 kB
  • sloc: perl: 1,621; makefile: 548
file content (61 lines) | stat: -rw-r--r-- 1,607 bytes parent folder | download | duplicates (6)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/perl

use warnings;
use strict;
use utf8;
use open qw(:std :utf8);
use lib qw(lib ../lib);

use Test::More tests    => 9;
use Encode qw(decode encode);


BEGIN {
    # Подготовка объекта тестирования для работы с utf8
    my $builder = Test::More->builder;
    binmode $builder->output,         ":utf8";
    binmode $builder->failure_output, ":utf8";
    binmode $builder->todo_output,    ":utf8";

    note "************* DBIx::DR::Util *************";
    use_ok 'DBIx::DR::Util';
}


my ($module, $method) = camelize 'test-module_name#foo';
ok $module eq 'Test::ModuleName', 'camelize "test-module_name#foo": module';
ok $method eq 'foo', 'camelize "test-module_name#foo": method';

($module, $method) = camelize 'dbix-dr-iterator#new';
ok $module eq 'DBIx::DR::Iterator', 'camelize "dbix-dr-iterator#new": module';
ok $method eq 'new', 'camelize "dbix-dr-iterator#new": method';


($module, $method) = camelize 'dbix-dr-iterator';
ok $module eq 'DBIx::DR::Iterator', 'camelize "dbix-dr-iterator": module';
ok !defined $method, 'camelize "dbix-dr-iterator": method';

cmp_ok
    'test-module-sub_module#new',
    'eq',
    decamelize('Test::Module::SubModule', 'new'),
    'decamelize Test::Module::SubModule->new'
;

cmp_ok
    'test',
    'eq',
    decamelize('Test'),
    'decamelize Test'
;

=head1 COPYRIGHT

 Copyright (C) 2011 Dmitry E. Oboukhov <unera@debian.org>
 Copyright (C) 2011 Roman V. Nikolaev <rshadow@rambler.ru>

 This program is free software, you can redistribute it and/or
 modify it under the terms of the Artistic License.

=cut