File: Trace.t

package info (click to toggle)
perl-tk 1%3A804.030-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 33,712 kB
  • sloc: ansic: 349,532; perl: 51,961; sh: 17,904; makefile: 5,730; asm: 3,565; ada: 1,681; pascal: 1,089; cpp: 1,006; yacc: 883; cs: 879
file content (29 lines) | stat: -rw-r--r-- 730 bytes parent folder | download | duplicates (8)
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
BEGIN { $|=1; $^W=1; }
use strict;
use Test;
use Tk;
plan test => 7;
my $var = 'One';
my $mw = MainWindow->new;
my $e  = $mw->Entry(-textvariable => \$var)->pack;
ok($e->get,$var,"Entry not initialized from variable");
$e->delete(0,'end');
ok($var,'',"Delete does not change variable");
$e->insert(0,'Two');
ok($var,'Two',"Insert does not change variable");
$var = 'Three';
ok($e->get,$var,"Entry does not track variable assignment");
chop($var);
ok($e->get,'Thre',"Entry does not track chop-ing variable");

my $nv;
$mw->Entry(-textvariable => \$nv);
$nv = 3/2;
ok($nv, 3/2, "IV should not override NV");

my $pv_chop = 421;
chop($pv_chop);
$mw->Entry(-textvariable => \$pv_chop);
ok($pv_chop, "42", "PV flag not set");

__END__