File: 0firebutton.t

package info (click to toggle)
libtk-gbarr-perl 2.08-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 284 kB
  • sloc: perl: 1,875; makefile: 19
file content (75 lines) | stat: -rwxr-xr-x 1,661 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
use strict;
use vars '$loaded';

my $top1;
my $top2;
BEGIN {
    if (!eval {
	# two MainWindows test...
	require Tk;
	$top1 = MainWindow->new;
	$top2 = MainWindow->new;
    }) {
	print "1..0 # skip cannot open DISPLAY\n";
	CORE::exit;
    }
}

BEGIN { $^W= 1; $| = 1; print "1..10\n"; }
END {print "not ok 1\n" unless $loaded;}
use Tk::FireButton;
$loaded = 1;
my $ok = 1;
print "ok " . $ok++ . "\n";

my $fb;
eval {
    $fb = $top1->FireButton;
          $top2->FireButton;
};
if ($@) { print "not " } print "ok " . $ok++ . "\n";

{
    local $^W = 0; # suppress "used only once" warnings
    eval q{
	$top1->FireButton(-bitmap => $Tk::Bitmap::INCBITMAP);
    };
    if ($@) { print "not " } print "ok " . $ok++ . "\n";

    eval q{
	$top2->FireButton(-bitmap => $Tk::Bitmap::DECBITMAP);
    };
    if ($@) { print "not " } print "ok " . $ok++ . "\n";

    eval q{
	$top1->FireButton(-bitmap => $Tk::Bitmap::HORIZINCBITMAP);
    };
    if ($@) { print "not " } print "ok " . $ok++ . "\n";

    eval q{
	$top2->FireButton(-bitmap => $Tk::Bitmap::HORIZDECBITMAP);
    };
    if ($@) { print "not " } print "ok " . $ok++ . "\n";

    my $r;
    eval q{
	$r = $fb->INCBITMAP eq $Tk::Bitmap::INCBITMAP;
    };
    if ($@) { print "not " } print "ok " . $ok++ . "\n";

    eval q{
	$r = $fb->DECBITMAP eq $Tk::Bitmap::DECBITMAP;
    };
    if ($@) { print "not " } print "ok " . $ok++ . "\n";

    eval q{
	$r = $fb->HORIZINCBITMAP eq $Tk::Bitmap::HORIZINCBITMAP;
    };
    if ($@) { print "not " } print "ok " . $ok++ . "\n";

    eval q{
	$r = $fb->HORIZDECBITMAP eq $Tk::Bitmap::HORIZDECBITMAP;
    };
    if ($@) { print "not " } print "ok " . $ok++ . "\n";
}