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

« back to all changes in this revision

Viewing changes to t/76-preferences.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 => 10;
13
 
}
14
 
 
15
 
use Test::NoWarnings;
16
 
use t::lib::Padre;
17
 
use Padre::Wx;
18
 
use Padre;
19
 
use_ok('Padre::Wx::Dialog::Preferences');
20
 
 
21
 
# Create the IDE
22
 
my $padre = new_ok('Padre');
23
 
my $main  = $padre->wx->main;
24
 
isa_ok( $main, 'Padre::Wx::Main' );
25
 
 
26
 
# Create the Preferences 2.0 dialog
27
 
my $dialog = new_ok( 'Padre::Wx::Dialog::Preferences', [$main] );
28
 
 
29
 
# Check the listview properties
30
 
my $treebook = $dialog->treebook;
31
 
isa_ok( $treebook, 'Wx::Treebook' );
32
 
 
33
 
#my $listview = $treebook->GetListView;
34
 
#isa_ok( $listview, 'Wx::ListView' );
35
 
#is( $listview->,       8,   'Found siz items' );
36
 
#is( $listview->GetColumnCount,     0,   'Found one column' );
37
 
#is( $listview->GetColumnWidth(-1), 100, 'Got column width' );
38
 
 
39
 
# Load the dialog from configuration
40
 
my $config = $main->config;
41
 
isa_ok( $config, 'Padre::Config' );
42
 
ok( $dialog->config_load($config), '->load ok' );
43
 
 
44
 
# The diff (extracted from dialog) to the config should be null,
45
 
# except maybe for a potential default font value. This is because
46
 
# SetSelectedFont() doesn't work on wxNullFont.
47
 
my $diff = $dialog->config_diff($config);
48
 
if ($diff) {
49
 
        is scalar keys %$diff, 1, 'only one key defined in the diff';
50
 
        ok exists $diff->{editor_font}, 'only key defined is "editor_font"';
51
 
} else {
52
 
        ok !$diff, 'null font loaded, config_diff() returned nothing';
53
 
        ok 1, 'placebo to stick to the plan';
54
 
}
55