Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 5561d4df28
Fetching contributors…

Cannot retrieve contributors at this time

executable file 61 lines (45 sloc) 1.638 kB
#!perl
# Copyright (C) 2006-2007, The Parrot Foundation.
# the following lines re-execute this as a tcl script
# the \ at the end of these lines makes them a comment in tcl \
use lib qw(lib); #\
use Tcl::Test; #\
__DATA__
source lib/test_more.tcl
plan 13
# [file exists]
eval_is {file exists} \
{wrong # args: should be "file exists name"} \
{[file exists] too few args}
eval_is {file exists foo bar} \
{wrong # args: should be "file exists name"} \
{[file exists] too many args}
# this should fail everywhere
is [file exists :%:/bar] 0 {[file exists] does not exist}
# we really should create a file to test this, but since our "source" line
# above means we have to have that path to this file..
is [file exists lib/test_more.tcl] 1 {[file exists] does exist}
# [file rootname]
eval_is {file rootname} \
{wrong # args: should be "file rootname name"} \
{[file rootname] too few args}
eval_is {file rootname foo bar} \
{wrong # args: should be "file rootname name"} \
{[file rootname] too many args}
is [file rootname file] file \
{[file rootname] filename only}
is [file rootname file.ext] file \
{[file rootname] filename with extension}
is [file rootname f..i.le.ext] f..i.le \
{[file rootname] filename with dots and extension}
# [file dirname]
eval_is {file dirname} \
{wrong # args: should be "file dirname name"} \
{[file dirname] too few args}
eval_is {file dirname foo bar} \
{wrong # args: should be "file dirname name"} \
{[file dirname] too many args}
is [file dirname .] . \
{[file dirname] dirname dot}
is [file dirname file.ext] . \
{[file dirname] dirname simple file}
Jump to Line
Something went wrong with that request. Please try again.