Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2002-07-05
17:42 • Closed ticket [575853ffff]: source.test needs writable . plus 4 other change... artifact: 8d6b235b13 user: dkf
2002-07-01
07:13 • New ticket [575853ffff]. artifact: 20331bb4b6 user: dgp

source.test needs writable .

Closed / Fixed575853ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 24 years ago
Descriptionplain2002-07-01 07:13:06
See Tcl Bug 575817.

source.test fails:

==== source-1.1 source command FAILED
==== Contents of test case:

    set x "old x value"
    set y "old y value"
    set z "old z value"
    makeFile {
        set x 22
        set y 33
        set z 44
    } source.file
    source source.file
    list $x $y $z

---- Result was:
couldn't read file "source.file": no such file or directory
---- Result should have been (exact matching):
22 33 44
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== source-1.1 FAILED


==== source-1.2 source command FAILED
==== Contents of test case:

    makeFile {list result} source.file
    source source.file

---- Result was:
couldn't read file "source.file": no such file or directory
---- Result should have been (exact matching):
result
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== source-1.2 FAILED


==== source-1.3 source command FAILED
==== Contents of test case:

    set y {\ }

    set fd [open source.file w]
    fconfigure $fd -translation lf
    puts -nonewline $fd "list a b c "
    puts $fd [string index $y 0]
    puts $fd "d e f"
    close $fd

    source source.file

---- Result was:
couldn't open "source.file": permission denied
---- Result should have been (exact matching):
a b c d e f
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== source-1.3 FAILED


==== source-2.3 source error conditions FAILED
==== Contents of test case:

    makeFile {
        set x 146
        error "error in sourced file"
        set y $x
    } source.file
    list [catch {source source.file} msg] $msg $errorInfo

---- Result was:
1 {couldn't read file "source.file": no such file or
directory} {couldn't read file "source.file": no such
file or directory
    while executing
"source source.file"}
---- Result should have been (exact matching):
1 {error in sourced file} {error in sourced file
    while executing
"error "error in sourced file""
    (file "source.file" line 3)
    invoked from within
"source source.file"}
==== source-2.3 FAILED


==== source-2.4 source error conditions FAILED
==== Contents of test case:

    makeFile {break} source.file
    catch {source source.file}

---- Result was:
1
---- Result should have been (exact matching):
3
==== source-2.4 FAILED


==== source-2.5 source error conditions FAILED
==== Contents of test case:

    makeFile {continue} source.file
    catch {source source.file}

---- Result was:
1
---- Result should have been (exact matching):
4
==== source-2.5 FAILED


==== source-3.1 return in middle of source file FAILED
==== Contents of test case:

    makeFile {
        set x new-x
        return allDone
        set y new-y
    } source.file
    set x old-x
    set y old-y
    set z [source source.file]
    list $x $y $z

---- Result was:
couldn't read file "source.file": no such file or directory
---- Result should have been (exact matching):
new-x old-y allDone
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== source-3.1 FAILED


==== source-3.2 return with special code etc. FAILED
==== Contents of test case:

    makeFile {
        set x new-x
        return -code break "Silly result"
        set y new-y
    } source.file
    list [catch {source source.file} msg] $msg

---- Result was:
1 {couldn't read file "source.file": no such file or
directory}
---- Result should have been (exact matching):
3 {Silly result}
==== source-3.2 FAILED


==== source-3.3 return with special code etc. FAILED
==== Contents of test case:

    makeFile {
        set x new-x
        return -code error "Simulated error"
        set y new-y
    } source.file
    list [catch {source source.file} msg] $msg
$errorInfo $errorCode

---- Result was:
1 {couldn't read file "source.file": no such file or
directory} {couldn't read file "source.file": no such
file or directory
    while executing
"source source.file"} {POSIX ENOENT {no such file or
directory}}
---- Result should have been (exact matching):
1 {Simulated error} {Simulated error
    while executing
"source source.file"} NONE
==== source-3.3 FAILED


==== source-3.4 return with special code etc. FAILED
==== Contents of test case:

    makeFile {
        set x new-x
        return -code error -errorinfo "Simulated
errorInfo stuff"
        set y new-y
    } source.file
    list [catch {source source.file} msg] $msg
$errorInfo $errorCode

---- Result was:
1 {couldn't read file "source.file": no such file or
directory} {couldn't read file "source.file": no such
file or directory
    while executing
"source source.file"} {POSIX ENOENT {no such file or
directory}}
---- Result should have been (exact matching):
1 {} {Simulated errorInfo stuff
    invoked from within
"source source.file"} NONE
==== source-3.4 FAILED


==== source-3.5 return with special code etc. FAILED
==== Contents of test case:

    makeFile {
        set x new-x
        return -code error -errorinfo "Simulated
errorInfo stuff"  -errorcode {a b c}
        set y new-y
    } source.file
    list [catch {source source.file} msg] $msg
$errorInfo $errorCode

---- Result was:
1 {couldn't read file "source.file": no such file or
directory} {couldn't read file "source.file": no such
file or directory
    while executing
"source source.file"} {POSIX ENOENT {no such file or
directory}}
---- Result should have been (exact matching):
1 {} {Simulated errorInfo stuff
    invoked from within
"source source.file"} {a b c}
==== source-3.5 FAILED


==== source-6.1 source is binary ok FAILED
==== Contents of test case:

    set x {}
    makeFile [list set x "a b\0c"] source.file
    source source.file
    string length $x

---- Result was:
couldn't read file "source.file": no such file or directory
---- Result should have been (exact matching):
5
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== source-6.1 FAILED


==== source-6.2 source skips everything after Ctrl-Z:
Bug 2040 FAILED
==== Contents of test case:

    set x {}
    makeFile [list set x "ab\32c"] source.file
    source source.file
    string length $x

---- Result was:
couldn't read file "source.file": no such file or directory
---- Result should have been (exact matching):
2
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== source-6.2 FAILED
dkf Closed ticket [575853ffff]. [History diff]2002-07-05 17:42:41
Log in (anonymous is fine) to add a comment.