~ubuntu-branches/ubuntu/saucy/padre/saucy-proposed

« back to all changes in this revision

Viewing changes to t/43-perl-utils.t

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov
  • Date: 2010-12-11 20:56:34 UTC
  • mfrom: (1.3.1 upstream) (13.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20101211205634-sitpxguuf9cct47q
Tags: 0.76.ds1-1
* New upstream release

* bump liborlite (build-)dependency to 1.46
* bump libparse-errorstring-perl-perl (build-)dependency to 0.14
* bump libwx-perl-processstream-perl (build-)dependency to 0.29
* update the list of incomplete manuals

* Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use strict;
 
4
use warnings;
 
5
use Test::More;
 
6
 
 
7
 
 
8
BEGIN {
 
9
        unless ( $ENV{DISPLAY} or $^O eq 'MSWin32' ) {
 
10
                plan skip_all => 'Needs DISPLAY';
 
11
                exit 0;
 
12
        }
 
13
 
 
14
        plan( tests => 5 );
 
15
}
 
16
use Test::NoWarnings;
 
17
 
 
18
# badcode was complaining it was missing
 
19
# in truth, this test doesn't appear to need padre
 
20
# to run, but it's either add this to satisfy the xt/badcode.t
 
21
# test or add it to the %SKIP, which makes even less sense.
 
22
use t::lib::Padre;
 
23
require Padre::Document::Perl;
 
24
 
 
25
# Create the object so that Padre->ide works
 
26
#my $app = Padre->new;
 
27
#isa_ok( $app, 'Padre' );
 
28
 
 
29
*_find_sub_decl_line_number = *Padre::Document::Perl::_find_sub_decl_line_number;
 
30
 
 
31
SCOPE: {
 
32
        my $code = <<'EOT';
 
33
                line 0;
 
34
                sub test {
 
35
                }
 
36
EOT
 
37
        is( _find_sub_decl_line_number( 'test', $code ), 1 );
 
38
}
 
39
 
 
40
SCOPE: {
 
41
        my $code = <<'EOT';
 
42
                line 0;
 
43
                sub test;
 
44
                sub test {
 
45
                }
 
46
EOT
 
47
        is( _find_sub_decl_line_number( 'test', $code ), 2 );
 
48
}
 
49
SCOPE: {
 
50
        my $code = <<'EOT';
 
51
                line 0;
 
52
                sub test($;$@);
 
53
                sub test {
 
54
                }
 
55
EOT
 
56
        is( _find_sub_decl_line_number( 'test', $code ), 2 );
 
57
}
 
58
SCOPE: {
 
59
        my $code = <<'EOT';
 
60
                line 0;
 
61
                sub test($;$@);
 
62
                sub test($;$@) {
 
63
                }
 
64
EOT
 
65
        is( _find_sub_decl_line_number( 'test', $code ), 2 );
 
66
}