~ubuntu-branches/ubuntu/lucid/padre/lucid

« back to all changes in this revision

Viewing changes to t/99-perl-func-list.t

  • Committer: Bazaar Package Importer
  • Author(s): Damyan Ivanov, gregor herrmann, Damyan Ivanov
  • Date: 2009-11-18 17:48:27 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20091118174827-srz62scl23gdl88v
Tags: 0.50.ds1-1
[ gregor herrmann ]
* debian/control: change dependency on "libclass-xsaccessor-array-perl
  (>= 1.02)" to "libclass-xsaccessor-perl (>= 1.05-2) |
  libclass-xsaccessor-array-perl (>= 1.02)".

[ Damyan Ivanov ]
* New upstream release
  + copyright: add a new translator
    - describe share/doc/perlopref copyright and licensing
  + update patches:
    - refresh disable-tcp-server.patch
    - drop fix-man-whatis.patch and fix-pod.patch (merged upstream)
    - drop fix-helpprovider-with-no-perlopref.patch: no longer necessary
* repack.sh: in 0.49 padre.exe moved from script/ to bin/
  + perlopref is now properly licensed
* add perl (>= 5.10.1) as a preferred alternative to versioned (build)
  dependencies on libtest-simple-perl and libpod-simple-perl
* update debian/not-real-manual.list for 0.50 (one file added, two files
  changed in size)
* rules: remove cruft from padre.deb
  + license etc from perlopref directory (already present in d/copyright)
  + remove .po files from the .deb (there are .mo files installed)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
 
 
3
use 5.006;
 
4
use strict;
 
5
use warnings;
 
6
use Test::More tests => 2;
 
7
 
 
8
use Padre::Document::Perl;
 
9
 
 
10
package main_mockup;
 
11
 
 
12
sub new { return bless {}, shift }
 
13
 
 
14
sub text_get {
 
15
 
 
16
        return <<'EOTEXT';
 
17
sub test1 {
 
18
}
 
19
 
 
20
sub test2 {}
 
21
 
 
22
#sub test3 {
 
23
#       my $self = shift;
 
24
#}
 
25
 
 
26
# sub test4 { }
 
27
 
 
28
&test2; # sub test5 {}
 
29
 
 
30
print "hello"; sub test6 {}
 
31
 
 
32
# hello sub test7 {}
 
33
 
 
34
sub test9 {} sub test10 {}
 
35
 
 
36
print sub test11 {}
 
37
 
 
38
$var =~ m#test#; sub test12 {}
 
39
 
 
40
$var2 = "testing the # character"; sub test13 {}
 
41
 
 
42
$var3 = "testing the \"#\" character again"; sub test14 {}
 
43
 
 
44
$var4 =~ s/change # to/ " /g; sub test15 {} $var4 =~ s/change # to/ " /g; sub test16 {}
 
45
 
 
46
$var5 = " s#change#string "; sub test17 {}
 
47
 
 
48
$var6 =~ s#sub test18 {}#sub test19 {}#
 
49
 
 
50
$var7 =~ s#sub test20 {}#sub #
 
51
 
 
52
$var8 =~ s#sub test21 {}#sub #; sub test22
 
53
{}
 
54
 
 
55
=head1
 
56
 
 
57
sub test23 {
 
58
        my $self = shift;
 
59
}
 
60
 
 
61
=cut
 
62
 
 
63
sub test24 {}
 
64
 
 
65
m{sub test25}
 
66
 
 
67
tr/sub test26//;
 
68
 
 
69
s(
 
70
        sub test27 {}
 
71
)()gx;
 
72
 
 
73
__END__
 
74
sub test28 {
 
75
        my $self = shift;
 
76
}
 
77
sub test29 {}
 
78
 
 
79
 
 
80
EOTEXT
 
81
}
 
82
 
 
83
package main;
 
84
 
 
85
my $main      = main_mockup->new;
 
86
my @functions = Padre::Document::Perl::get_functions($main);
 
87
 
 
88
my @expected = qw(test1 test2 test6 test9 test10 test12 test13 test14 test15 test16 test17 test22 test24);
 
89
 
 
90
is( scalar @functions, scalar @expected, "all valid subs should be detected" );
 
91
 
 
92
is_deeply( \@functions, [@expected], "find correct sub names" );