File: info.t

package info (click to toggle)
libtcl-perl 1.32%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 288 kB
  • sloc: perl: 417; tcl: 19; makefile: 14
file content (32 lines) | stat: -rw-r--r-- 798 bytes parent folder | download
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
use strict;
use Test qw(plan ok);

plan tests => 6, todo=>[2];

use Tcl;
use File::Spec::Functions;

my $tcl = Tcl->new;

ok($tcl);

my $interp = $^X;
if (!file_name_is_absolute($interp)) {
    #TODO use File::Which;
    #TODO $interp = which($interp);
}
if ($^O eq 'cygwin') {
    my $cpath = $tcl->Eval("info nameofexecutable");
    $cpath = `cygpath -u '$cpath'`;
    chomp($cpath);
    ok($cpath, canonpath($^X));
} else {
    # see ticket 25822
    ok(canonpath($tcl->Eval("info nameofexecutable")), canonpath($^X));
}
ok($tcl->Eval("info exists tcl_platform"), 1);

my $tclversion = $tcl->Eval("info tclversion");
ok($tclversion, qr/^\d+\.\d+$/);
ok(substr($tcl->Eval("info patchlevel"), 0, length($tclversion)), $tclversion);
ok(length($tcl->Eval("info patchlevel")) > length($tclversion));