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

« back to all changes in this revision

Viewing changes to t/02_new.t

  • Committer: Package Import Robot
  • Author(s): Dominique Dumont, gregor herrmann, Dominique Dumont
  • Date: 2012-01-04 12:04:20 UTC
  • mfrom: (1.3.3)
  • Revision ID: package-import@ubuntu.com-20120104120420-i5oybqwf91m1d3il
Tags: 0.92.ds1-1
[ gregor herrmann ]
* Remove debian/source/local-options; abort-on-upstream-changes
  and unapply-patches are default in dpkg-source since 1.16.1.
* Swap order of alternative (build) dependencies after the perl
  5.14 transition.

[ Dominique Dumont ]
* Imported Upstream version 0.92.ds1
* removed fix-spelling patch (applied upstream)
* lintian-override: use wildcard to avoid listing a gazillion files
* updated size of some 'not-real-man-page' entries
* rules: remove dekstop cruft (replaced by a file provided in debian
  directory)
* control: removed Breaks statement. Add /me to uploaders. Updated
  dependencies
* rules: make sure that non-DFSG file (i.e. the cute butterfly, sigh)
  is not distributed

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
BEGIN {
 
8
        unless ( $ENV{DISPLAY} or $^O eq 'MSWin32' ) {
 
9
                plan skip_all => 'Needs DISPLAY';
 
10
                exit 0;
 
11
        }
 
12
        plan( tests => 63 );
 
13
}
 
14
use Test::NoWarnings;
 
15
use t::lib::Padre;
 
16
use Padre;
 
17
 
 
18
my $app = Padre->new;
 
19
isa_ok( $app, 'Padre' );
 
20
 
 
21
SCOPE: {
 
22
        my $ide = Padre->ide;
 
23
        isa_ok( $ide, 'Padre' );
 
24
        refis( $ide, $app, '->ide matches ->new' );
 
25
}
 
26
 
 
27
SCOPE: {
 
28
        my $ide = Padre::Current->ide;
 
29
        isa_ok( $ide, 'Padre' );
 
30
        refis( $ide, $app, '->ide matches ->new' );
 
31
}
 
32
 
 
33
SCOPE: {
 
34
        my $config = $app->config;
 
35
        isa_ok( $config, 'Padre::Config' );
 
36
 
 
37
        is( $config->startup_files        => 'new' );
 
38
        is( $config->main_lockinterface   => 1 );
 
39
        is( $config->main_functions       => 0 );
 
40
        is( $config->main_functions_order => 'alphabetical' );
 
41
        is( $config->main_outline         => 0 );
 
42
        is( $config->main_directory       => 0 );
 
43
        is( $config->main_output          => 0 );
 
44
        is( $config->main_output_ansi     => 1 );
 
45
        is( $config->main_syntaxcheck     => 0 );
 
46
        is( $config->main_statusbar       => 1 );
 
47
 
 
48
        my $editor_font = $config->editor_font;
 
49
        if ( $^O eq 'MSWin32' ) {
 
50
                ok( ( $editor_font eq '' ) || ( $editor_font eq 'consolas 10' ),
 
51
                        'editor_font is either empty or consolas 10 on win32'
 
52
                );
 
53
        } else {
 
54
                is( $editor_font => '' );
 
55
        }
 
56
 
 
57
        is( $config->editor_linenumbers       => 1 );
 
58
        is( $config->editor_eol               => 0 );
 
59
        is( $config->editor_indentationguides => 0 );
 
60
        is( $config->editor_calltips          => 0 );
 
61
        is( $config->editor_autoindent        => 'deep' );
 
62
        is( $config->editor_whitespace        => 0 );
 
63
        is( $config->editor_folding           => 0 );
 
64
        is( $config->editor_wordwrap          => 0 );
 
65
        is( $config->editor_currentline       => 1 );
 
66
        is( $config->editor_currentline_color => 'FFFF04' );
 
67
        is( $config->editor_indent_auto       => 1 );
 
68
        is( $config->editor_indent_tab_width  => 8 );
 
69
        is( $config->editor_indent_width      => 8 );
 
70
        is( $config->editor_indent_tab        => 1 );
 
71
        is( $config->lang_perl5_beginner      => 1 );
 
72
        is( $config->find_case                => 1 );
 
73
        is( $config->find_regex               => 0 );
 
74
        is( $config->find_reverse             => 0 );
 
75
        is( $config->find_first               => 0 );
 
76
        is( $config->find_nohidden            => 1 );
 
77
        is( $config->run_save                 => 'same' );
 
78
        is( $config->threads                  => 1 );
 
79
        is( $config->locale                   => '' );
 
80
        is( $config->locale_perldiag          => '' );
 
81
        is( $config->editor_style             => 'default' );
 
82
        is( $config->main_maximized           => 0 );
 
83
        is( $config->main_top                 => -1 );
 
84
        is( $config->main_left                => -1 );
 
85
        is( $config->main_width               => -1 );
 
86
        is( $config->main_height              => -1 );
 
87
}
 
88
 
 
89
 
 
90
 
 
91
 
 
92
 
 
93
#####################################################################
 
94
# Internal Structure Tests
 
95
 
 
96
# These test that the internal structure of the application matches
 
97
# expected normals, and that structure navigation methods works normally.
 
98
SCOPE: {
 
99
        my $padre = Padre->ide;
 
100
        isa_ok( $padre, 'Padre' );
 
101
 
 
102
        # The Wx::App(lication)
 
103
        my $app = $padre->wx;
 
104
        isa_ok( $app, 'Padre::Wx::App' );
 
105
 
 
106
        # The main window
 
107
        my $main = $app->main;
 
108
        isa_ok( $main, 'Padre::Wx::Main' );
 
109
 
 
110
        # By default, most of the tools shouldn't exist
 
111
        ok( !$main->has_output,  '->has_output is false' );
 
112
        ok( !$main->has_outline, '->has_outline is false' );
 
113
        ok( !$main->has_syntax,  '->has_syntax is false' );
 
114
 
 
115
        # The main menu
 
116
        my $menu = $main->menu;
 
117
        isa_ok( $menu, 'Padre::Wx::Menubar' );
 
118
        refis( $menu->main, $main, 'Menubar ->main gets the main window' );
 
119
 
 
120
        # A submenu
 
121
        my $file = $menu->file;
 
122
        isa_ok( $file, 'Padre::Wx::Menu' );
 
123
 
 
124
        # The notebook
 
125
        my $notebook = $main->notebook;
 
126
        isa_ok( $notebook, 'Padre::Wx::Notebook' );
 
127
 
 
128
        # Current context
 
129
        my $current = $main->current;
 
130
        isa_ok( $current,           'Padre::Current' );
 
131
        isa_ok( $current->main,     'Padre::Wx::Main' );
 
132
        isa_ok( $current->notebook, 'Padre::Wx::Notebook' );
 
133
        refis( $current->main,     $main,     '->current->main ok' );
 
134
        refis( $current->notebook, $notebook, '->current->notebook ok' );
 
135
}