Debian Codegraph @

t/KR.t

raw
1 use Tk;
2 ## Be optimistic, run the test everywhere.
3 ## It won't fail if fonts are missing, just
4 ## empty lines will be shown.
5 # use Tk::Config ();
6 # use Encode qw(FB_CROAK);
7 # BEGIN
8 # {
9 # my $Xft = $Tk::Config::xlib =~ /-lXft\b/;
10 # if (!$Xft) # assume we have CJK charsets with ttf fonts available
11 # {
12 # my $enc = Tk::SystemEncoding();
13 # eval { $enc->encode("\x{AC00}",FB_CROAK) };
14 # if ($@)
15 # {
16 # my $err = "$@";
17 # print "1..0 # Skipped: locale's '",$enc->name,"' cannot represent Korean.\n";
18 # CORE::exit(0);
19 # }
20 # }
21 # }
22 use Test::More (tests => 271);
23 use Tk::widgets qw(Text);
24 my $mw = MainWindow->new;
25 $mw->geometry("+10+10");
26 my $font = 'Times';
27 #my $font = 'fixed';
28 my $t = $mw->Scrolled(Text => -font => [$font => 12, 'normal'])->pack( -fill => 'both', -expand => 1);
29 my $file = __FILE__;
30 $file =~ s/\.t$/.dat/;
31 open(my $fh,"<:utf8",$file) || die "Cannot open $file:$!";
32 while (<$fh>)
33 {
34 # s/[^ -~\s]/?/g;
35 $t->insert('end',$_);
36 $t->see('end');
37 $mw->update;
38 ok(1);
39 }
40 close($fh);
41 $mw->after(100,[ destroy => $mw ]);
42 MainLoop;