Tcl Source Code

Artifact [75b4e515b9]
Login

Artifact 75b4e515b9ae9448e0b78eafb8b788410dcd88b7:

Attachment "fileName+.test" to ticket [408840ffff] added by vincentdarley 2001-07-27 20:13:58.
# Test '-tails' flag to glob.
test filename-11.36 {Tcl_GlobCmd} {
    list [catch {glob -tails *} msg] $msg
} {1 {"-tails" must be used with either "-directory" or "-path"}}
test filename-11.37 {Tcl_GlobCmd} {
    list [catch {glob -type d -tails -path $globname *} msg] $msg
} [list 0 [list $globname]]
test filename-11.38 {Tcl_GlobCmd} {
    list [catch {glob -tails -path $globname *} msg] $msg
} [list 0 [list $globname]]
test filename-11.39 {Tcl_GlobCmd} {
    list [catch {glob -tails -join -path $globname *} msg] $msg
} [list 0 [list $globname]]
test filename-11.40 {Tcl_GlobCmd} {
    expr {[glob -dir [pwd] -tails *] == [glob *]}
} {1}
test filename-11.41 {Tcl_GlobCmd} {
    expr {[glob -dir [pwd] -tails *] != [glob -dir [pwd] *]}
} {1}
test filename-11.42 {Tcl_GlobCmd} {
    set res [list]
    foreach f [glob -dir [pwd] *] {
	lappend res [file tail $f]
    }
    expr {$res == [glob *]}
} {1}
test filename-11.43 {Tcl_GlobCmd} {
    list [catch {glob -t *} msg] $msg
} {1 {ambiguous option "-t": must be -directory, -join, -nocomplain, -path, -tails, -types, or --}}
test filename-11.44 {Tcl_GlobCmd} {
    list [catch {glob -tails -path hello -directory hello *} msg] $msg
} {1 {"-directory" cannot be used with "-path"}}