tagged release 0.7.1
[parrot.git] / languages / tcl / t / cmd_cd.t
blob8c98ea9a2aa69e3f0cbdf07168fbf39aecf7ddb5
1 #!perl
3 # Copyright (C) 2006, The Perl Foundation.
4 # $Id$
6 use strict;
7 use warnings;
8 use lib qw(tcl/lib ./lib ../lib ../../lib ../../../lib);
10 use Parrot::Test tests => 3;
11 use Test::More;
12 use File::Temp qw(tempdir);
13 use File::Spec;
14 use Cwd qw(abs_path);
16 language_output_is( "tcl", <<'TCL', <<OUT, "cd too many args" );
17  cd a b
18 TCL
19 wrong # args: should be "cd ?dirName?"
20 OUT
22 ## tclsh on windows shows unix slashies, so use unix canonpath to get them
23 my $homedir = File::Spec::Unix->canonpath( $ENV{HOME} );
25 TODO: {
26     local $TODO;
27     $TODO = 'pwd is broken on windows' if $^O eq 'MSWin32';
29     language_output_is( "tcl", <<'TCL', <<"OUT", "cd home" );
30  cd
31  puts [pwd]
32 TCL
33 $homedir
34 OUT
38     my $testdir = tempdir( CLEANUP => 1 );
39     my $expdir = File::Spec->canonpath( abs_path($testdir) );
40     $^O eq 'MSWin32' and $testdir =~ s/\\/\\\\/g;
41     language_output_is( "tcl", <<"TCL", <<"OUT", "cd home" );
42  cd $testdir
43  puts [pwd]
44 TCL
45 $expdir
46 OUT
49 # Local Variables:
50 #   mode: cperl
51 #   cperl-indent-level: 4
52 #   fill-column: 100
53 # End:
54 # vim: expandtab shiftwidth=4: