Skip to content
Tcl Source Code View Ticket
Login

View Ticket

fCmd-28.12: broken test

Closed / Fixed883143ffffffffffffffffffffffffffffffffffCreated 23 years agoUpdated 23 years ago
Descriptionplain2004-01-23 17:34:19
==== fCmd-28.12 file link: cd into a link FAILED
==== Contents of test case:

    cd [temporaryDirectory]
    file delete -force abc.link
    file link abc.link abc.dir
    set orig [pwd]
    cd abc.link
    set dir [pwd]
    cd ..
    set up [pwd]
    cd $orig
    # now '$up' should be either $orig or [file dirname
abc.dir],
    # depending on whether 'cd' actually moves to the
destination
    # of a link, or simply treats the link as a directory.
    # (on windows the former, on unix the latter, I
believe)
    if {([file normalize $up] != [file normalize
$orig])  && ([file normalize $up] != [file normalize
[file dirname abc.dir]])} {
        set res "wrong directory with 'cd $link ; cd ..'"
    } else {
        set res "ok"
    }
    cd [workingDirectory]
    set res

---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
---- errorInfo: can't read "link": no such variable
    while executing
"set res "wrong directory with 'cd $link ; cd ..'""
    invoked from within
"if {([file normalize $up] != [file normalize $orig]) 
&& ([file normalize $up] != [file normalize [file
dirname abc.dir]])} {
        set res "wrong director..."
    ("uplevel" body line 15)
    invoked from within
"uplevel 1 $script"
---- errorCode: NONE
==== fCmd-28.12 FAILED

Note the test tries to read the value
of a variable "$link" that does not
exist.
vincentdarleyplain2004-01-24 01:35:04
Logged In: YES 
user_id=32170

Hmm, the test should say something like this:

set res "wrong directory with 'cd abc.link ; cd ..': \
  \"[file normalize $up]\" should be \"[file normalize
$orig]\" or\
  \"[file normalize [file dirname abc.dir]]\""

for maximal usefulness
dgpplain2004-01-26 23:09:35
Logged In: YES 
user_id=80530


Now the test runs, but fails:

==== fCmd-28.12 file link: cd into a link FAILED
==== Contents of test case:

    cd [temporaryDirectory]
    file delete -force abc.link
    file link abc.link abc.dir
    set orig [pwd]
    cd abc.link
    set dir [pwd]
    cd ..
    set up [pwd]
    cd $orig
    # now '$up' should be either $orig or [file dirname
abc.dir],
    # depending on whether 'cd' actually moves to the
destination
    # of a link, or simply treats the link as a directory.
    # (on windows the former, on unix the latter, I believe)
    if {([file normalize $up] != [file normalize $orig])  &&
([file normalize $up] != [file normalize [file dirname
abc.dir]])} {
        set res "wrong directory with 'cd abc.link ; cd ..':
 \"[file normalize $up]\" should be \"[file normalize
$orig]\" or \"[file normalize [file dirname abc.dir]]\""
    } else {
        set res "ok"
    }
    cd [workingDirectory]
    set res

---- Result was:
wrong directory with 'cd abc.link ; cd ..': 
"/local/src/tcl/solaris/abc.dir" should be
"/local/src/tcl/solaris" or "/local/src/tcl/solaris"
---- Result should have been (exact matching):
ok
==== fCmd-28.12 FAILED
vincentdarleyplain2004-01-27 23:44:10
Logged In: YES 
user_id=32170

Thanks -- it's very strange the 'cd .. ; set up [pwd]'
doesn't seem to get out of the abc.dir directory.  Could you
try to debug what is going on -- I don't really understand
the behaviour you're seeing, and I can't reproduce it (even
now I can access the compilefarm).
vincentdarleyplain2004-01-29 18:51:48
Logged In: YES 
user_id=32170

This is a genuine bug in latest cvs HEAD.  If you insert
'puts [pwd]' at various points in the test you'll see that
pwd is "abc.dir" at one point.  That is no good -- it should
be an absolute path.
vincentdarleyplain2004-01-29 20:02:53
Logged In: YES 
user_id=32170

Fixed in cvs.
Log in (anonymous is fine) to add a comment.