~ubuntu-branches/ubuntu/lucid/perl-tk/lucid

« back to all changes in this revision

Viewing changes to t/pixmap.t

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2008-02-15 13:56:59 UTC
  • mfrom: (1.1.3 upstream) (4.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080215135659-ru2oqlykuju20fav
Tags: 1:804.028-1
* New Upstream Release (Closes: #463080).
* Update to Debhelper v5.
* Build with XFT=1 (Closes: #411129).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl -w
2
2
use strict;
3
 
use Test;
4
 
plan tests => 1;
 
3
BEGIN {
 
4
    if (!eval q{
 
5
        use Test::More;
 
6
        1;
 
7
    }) {
 
8
        print "1..0 # skip: no Test::More module\n";
 
9
        exit;
 
10
    }
 
11
}
 
12
plan tests => 2;
5
13
 
6
14
my($icon)=<<'END';
7
15
/* XPM */
28
36
my $mw = tkinit;
29
37
$mw->geometry("+20+20");
30
38
my $label = $mw->Label(-image=>$mw->Pixmap(-data=>$icon))->pack;
31
 
$mw->after(1000,[destroy => $mw]);
 
39
pass("Loaded and displayed pixmap");
 
40
eval { $mw->Pixmap(-file => "__nonexistingpixmap__") };
 
41
like($@, qr{(\QCannot open '__nonexistingpixmap__' in mode 'r'\E
 
42
            |\Qcouldn't read file "__nonexistingpixmap__": No such file or directory\E
 
43
           )}x, "Non-existing xpm error");
 
44
$mw->after(500,[destroy => $mw]);
32
45
MainLoop;
33
 
ok(1);