File: sv.t

package info (click to toggle)
perl-tk 1%3A804.032-3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 34,728 kB
  • ctags: 37,169
  • sloc: ansic: 349,522; perl: 52,175; sh: 17,904; makefile: 5,732; asm: 3,565; ada: 1,681; pascal: 1,089; cpp: 1,006; yacc: 883; cs: 879
file content (47 lines) | stat: -rwxr-xr-x 895 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/perl -w
# -*- cperl -*-

#
# Author: Slaven Rezic
#

use strict;
use Test::More 'no_plan';
use Tk;

my $mw = tkinit;
$mw->geometry('+0+0');

{
    # a couple of test cases related to RT #90077
    {
	my $val = 0.20;
	{ no warnings 'void'; $val * 2 }
	is $val * 1, 0.20;

	{
	    my $e = $mw->Entry(-textvariable => \$val)->pack;
	    $e->destroy;
	}
	# This fails with perl < 5.18
	is $val * 1, 0.20 or
	    do { require Devel::Peek; Devel::Peek::Dump($val) }; # pv_dump says: FLAGS = (PADMY,IOK,NOK,POK,pIOK,pNOK,pPOK,UTF8)
    }

    {
	my $val = 0.20;
	{ no warnings 'void'; $val * 2 }
	is $val * 1, 0.20;

	{
	    my $e = $mw->Entry(-textvariable => \$val)->pack;
	    { no warnings 'void'; $val * 2 } # set the pIOK flag again
	    $e->destroy;
	}
	# This fails also with perl 5.18
	is $val * 1, 0.20 or
	    do { require Devel::Peek; Devel::Peek::Dump($val) };
    }
}

__END__