Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Test script "io.test" io-52.8 always fail; unexpandable $thi

Closed / Invalid217830ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:44:34
OriginalBugID: 1578 Bug
Version: 8.1b2
SubmitDate: '1999-03-22'
LastModified: '1999-03-24'
Severity: MED
Status: Closed
Submitter: pat
ChangedBy: admin
RelatedBugIDs: 1570
OS: SunOS
OSVersion: 5.6 (SPARC)
Machine: Sparc
FixedDate: '2000-10-25'
ClosedDate: '1999-03-24'


Name:
Taketo Kabe

ReproducibleScript:
    on UNIX source distribution,
       $ make test
    or
       $ env LD_LIBRARY_PATH=../unix ../unix/tcltest
       % cd ../tests
       % source io.test
    



ObservedBehavior:
    io-52.8 test fails as
    
    >> ---- Result was:
    >> 0 0
    



DesiredBehavior:
    >> ---- Result should have been:
    >> 40 40
    



Patch:
*** io.test.distSun Mar 14 03:08:21 1999
--- io.testSun Mar 21 23:44:00 1999
***************
*** 6408,6420 ****
      puts $f1 {
  puts ready
  gets stdin
! set f1 [open $thisScript r]
  fconfigure $f1 -translation lf
  puts [read $f1 100]
  close $f1
      }
      close $f1
!     set f1 [open "|[list $tcltest pipe]" r+]
      fconfigure $f1 -translation lf
      gets $f1
      puts $f1 ready
--- 6408,6420 ----
      puts $f1 {
  puts ready
  gets stdin
! set f1 [open [lindex $argv 0] r]
  fconfigure $f1 -translation lf
  puts [read $f1 100]
  close $f1
      }
      close $f1
!     set f1 [open "|[list $tcltest pipe $thisScript]" r+]
      fconfigure $f1 -translation lf
      gets $f1
      puts $f1 ready




PatchFiles:
    tests/io.test
    





    Former versions of io.test used "[info script]" to retrieve the script
    filename
    (mainly for obtaining read-only datafile), but 8.1b2 has optimized these
    to "$thisScript".
    No problem but for one place which is used in pipe-invoked interpreter.
    As the external interp can't resolve the filename, it just reads nothing
    and returns zero bytes.
    My patch passes $thisScript explicitly as an argument to resolve this.

This bug was already reported and patched in bug 1570.  03/24/1999 20:02 - admin -
welch Closed ticket [217830ffff]. [History diff]2000-10-26 07:59:45
dgp Ticket [217830ffff]: 4 changes [History diff]2001-04-05 08:23:14
Log in (anonymous is fine) to add a comment.