Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2000-10-26
08:31 • Closed ticket [218881ffff]: testsuite fixes for Linux/Alpha plus 4 other cha... artifact: 5253bc1bcb user: welch
01:07 • New ticket [218881ffff]. artifact: 4cfdd2b07f user: nobody

testsuite fixes for Linux/Alpha

Closed / Fixed218881ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 01:07:08
OriginalBugID: 2516 Bug
Version: 8.2b2
SubmitDate: '1999-08-10'
LastModified: '1999-08-11'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Other
OSVersion: RedHat Linux 5.1 on Alpha XL-300
Machine: NA
FixedDate: '1999-08-11'
FixedInVersion: 8.2
ClosedDate: '2000-10-25'


Name:

Don Porter


Comments:

String test fixes for a 64 bit platform suggested by Jeffrey Hobbs.


    tcltest::PrintError adds whitespace formatting to error messages.

    That whitespace must be removed before comparison to the expected

    message in the test suite.  I only fixed the test which was failing

    for me.  Apply the same strategy to other tests which compare against

    a message generated by tcltest::PrintError .


ObservedBehavior:

$ make test

    ...

    ==== string-6.37 string is double, false on int overflow FAILED

    ==== Contents of test case:


        list [string is double -fail var 12345678901234567890] $var


    ---- Result was:

    1 0

    ---- Result should have been:

    0 -1

    ==== string-6.37 FAILED


    ==== string-6.55 string is integer, false on overflow FAILED

    ==== Contents of test case:


        list [string is integer -fail var +12345678901234567890] $var


    ---- Result was:

    0 21

    ---- Result should have been:

    0 -1

    ==== string-6.55 FAILED


    ==== tcltest-8.2 tcltest a.tcl -tmpdir thisdirectoryisafile FAILED

    ==== Contents of test case:


        catch {exec $::tcltest::tcltest a.tcl -tmpdir thisdirectoryisafile}

    msg

        list [regexp "not a directory" $msg]


    ---- Result was:

    0 

    ---- Result should have been:

    1

    ==== tcltest-8.2 FAILED


DesiredBehavior:

No tests fail


Patch:

Index: string.test

===================================================================

RCS file: /cvsroot/tcl/tests/string.test,v

retrieving revision 1.19

diff -c -r1.19 string.test

*** string.test 1999/07/09 02:11:56     1.19

--- string.test 1999/08/09 05:36:46

***************

*** 245,250 ****

--- 245,257 ----

      string compare $i1 $i2

  } 0


+ proc largest_int {} {

+     set int 1

+     set exp 7; # assume we get at least 8 bits

+     while {$int > 0} { set int [expr {1 << [incr exp]}] }

+     return [expr {$int-1}]

+ }

+ 

  test string-6.1 {string is, too few args} {

      list [catch {string is} msg] $msg

  } {1 {wrong # args: should be "string is class ?-strict? ?-failindex var? str"

}}

***************

*** 355,361 ****

      list [string is double -fail var "\n"] $var

  } {0 0}

  test string-6.37 {string is double, false on int overflow} {

!     list [string is double -fail var 12345678901234567890] $var

  } {0 -1}

  test string-6.38 {string is double, false on underflow} {

      catch {unset var}

--- 362,368 ----

      list [string is double -fail var "\n"] $var

  } {0 0}

  test string-6.37 {string is double, false on int overflow} {

!     list [string is double -fail var [largest_int]0] $var

  } {0 -1}

  test string-6.38 {string is double, false on underflow} {

      catch {unset var}

***************

*** 416,422 ****

      list [string is integer -fail var 123abc] $var

  } {0 3}

  test string-6.55 {string is integer, false on overflow} {

!     list [string is integer -fail var +12345678901234567890] $var

  } {0 -1}

  test string-6.56 {string is integer, false} {

      list [string is integer -fail var [expr double(1)]] $var

--- 423,429 ----

      list [string is integer -fail var 123abc] $var

  } {0 3}

  test string-6.55 {string is integer, false on overflow} {

!     list [string is integer -fail var +[largest_int]0] $var

  } {0 -1}

  test string-6.56 {string is integer, false} {

      list [string is integer -fail var [expr double(1)]] $var

***************

*** 527,532 ****

--- 534,541 ----

  test string-6.89 {string is xdigit} {

      list [string is xdigit -fail var 0123456789\u0061bcdefABCDEFg] $var

  } {0 22}

+ 

+ rename largest_int {}


  test string-7.1 {string last, too few args} {

      list [catch {string last a} msg] $msg

Index: tcltest.test

===================================================================

RCS file: /cvsroot/tcl/tests/tcltest.test,v

retrieving revision 1.4

diff -c -r1.4 tcltest.test

*** tcltest.test        1999/07/30 19:10:47     1.4

--- tcltest.test        1999/08/09 05:36:46

***************

*** 230,235 ****

--- 230,236 ----

  } {1 {}}

  test tcltest-8.2 {tcltest a.tcl -tmpdir thisdirectoryisafile} {

      catch {exec $::tcltest::tcltest a.tcl -tmpdir thisdirectoryisafile} msg

+     regsub -all "\[ \r\t\n\]+" $msg " " msg

      list [regexp "not a directory" $msg]

  } {1}


PatchFiles:

string.test

    tcltest.test




These were integrated into 8.2b3. 
-- 08/11/1999 hobbs
welch Closed ticket [218881ffff]. [History diff]2000-10-26 08:31:14
Log in (anonymous is fine) to add a comment.