Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ddae1102c815e5a47ba31dd3cba0f5e5edc90333c55c46b91ca9a611da7a2e31
Ticket: 9c3663977bd4216db965eb418f99dfc4d7af4e8a
multiple [lseq] test failures
User & Date: dgp on 2022-09-28 12:16:37
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-plain"
  4. comment changed to:
    ==== lseq-1.11 error case: increasing wrong step direction FAILED
    ==== Contents of test case:
    
        lseq 1 to 10 by -2
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: max length of a Tcl list exceeded
        while executing
    "lseq 1 to 10 by -2"
        ("uplevel" body line 2)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL MEMORY
    ==== lseq-1.11 FAILED
    
    
    
    ==== lseq-1.20 bug: wrong length computed FAILED
    ==== Contents of test case:
    
        lseq 1 to 10 -1
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: max length of a Tcl list exceeded
        while executing
    "lseq 1 to 10 -1"
        ("uplevel" body line 2)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL MEMORY
    ==== lseq-1.20 FAILED
    
    
    
    ==== lseq-2.2 step magnitude FAILED
    ==== Contents of test case:
    
        lseq 10 1 2 ;# this is an empty case since step has wrong sign
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: max length of a Tcl list exceeded
        while executing
    "lseq 10 1 2 "
        ("uplevel" body line 2)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL MEMORY
    ==== lseq-2.2 FAILED
    
    
    
    ==== lseq-2.3 step wrong sign FAILED
    ==== Contents of test case:
    
        lseq 25. 5. 5 ;# ditto - empty list
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: max length of a Tcl list exceeded
        while executing
    "lseq 25. 5. 5 "
        ("uplevel" body line 2)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL MEMORY
    ==== lseq-2.3 FAILED
    
    
    
    ==== lseq-2.11 error case: increasing wrong step direction FAILED
    ==== Contents of test case:
    
        lseq 1 10 -2
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: max length of a Tcl list exceeded
        while executing
    "lseq 1 10 -2"
        ("uplevel" body line 2)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL MEMORY
    ==== lseq-2.11 FAILED
    
    
    
    ==== lseq-2.18 signs FAILED
    ==== Contents of test case:
    
        list [lseq -10 -1 2]  [lseq -10 -1 -1]  [lseq -10 1 -3]  [lseq 10 -1 -4]  [lseq -10 -1 3]  [lseq 10 1 -5]
    
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: max length of a Tcl list exceeded
        while executing
    "lseq -10 -1 -1"
        ("uplevel" body line 2)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL MEMORY
    ==== lseq-2.18 FAILED
    
    
    
    ==== lseq-3.29 edge case: negative count FAILED
    ==== Contents of test case:
    
        lseq -15
    
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: max length of a Tcl list exceeded
        while executing
    "lseq -15"
        ("uplevel" body line 2)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: TCL MEMORY
    ==== lseq-3.29 FAILED
    
    
    
    ==== lseq-4.3 TIP examples FAILED
    ==== Contents of test case:
    
        set examples {# Examples from TIP-629
            # --- Begin ---
            lseq 10 .. 1
            # -> 10 9 8 7 6 5 4 3 2 1
            lseq 1 .. 10
            # -> 1 2 3 4 5 6 7 8 9 10
            lseq 10 .. 1 by 2
            # ->
            lseq 10 .. 1 by -2
            # -> 10 8 6 4 2
            lseq 5.0 to 15.
            # -> 5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0
            lseq 5.0 to 25. by 5
            # -> 5.0 10.0 15.0 20.0 25.0
            lseq 25. to 5. by 5
            # ->
            lseq 25. to 5. by -5
            # -> 25.0 20.0 15.0 10.0 5.0
            lseq 1 to 10 by 2
            # -> 1 3 5 7 9
            lseq 25. to -25. by -5
            # -> 25.0 20.0 15.0 10.0 5.0 0.0 -5.0 -10.0 -15.0 -20.0 -25.0
            lseq 5 5
            # -> 5
            lseq 5 5 2
            # -> 5
            lseq 5 5 -2
            # -> 5
        }
    
        foreach {cmd expect} [split $examples \n] {
            if {[string trim $cmd] ne ""} {
                set cmd [string trimleft $cmd]
                if {[string match {\#*} $cmd]} continue
                set status [catch $cmd ans]
                lappend res $ans
                if {[regexp {\# -> (.*)$} $expect -> expected]} {
                    if {$expected ne $ans} {
                        lappend res [list Mismatch: $cmd -> $ans ne $expected]
                    }
                }
            }
        }
        set res
    
    ---- Result was:
    {10 9 8 7 6 5 4 3 2 1} {1 2 3 4 5 6 7 8 9 10} {max length of a Tcl list exceeded} {10 8 6 4 2} {5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0} {5.0 10.0 15.0 20.0 25.0} {max length of a Tcl list exceeded} {25.0 20.0 15.0 10.0 5.0} {1 3 5 7 9} {25.0 20.0 15.0 10.0 5.0 0.0 -5.0 -10.0 -15.0 -20.0 -25.0} 5 5 5
    ---- Result should have been (exact matching):
    {10 9 8 7 6 5 4 3 2 1} {1 2 3 4 5 6 7 8 9 10} {} {10 8 6 4 2} {5.0 6.0 7.0 8.0 9.0 10.0 11.0 12.0 13.0 14.0 15.0} {5.0 10.0 15.0 20.0 25.0} {} {25.0 20.0 15.0 10.0 5.0} {1 3 5 7 9} {25.0 20.0 15.0 10.0 5.0 0.0 -5.0 -10.0 -15.0 -20.0 -25.0} 5 5 5
    ==== lseq-4.3 FAILED
    
    
    
    ==== lseq-4.4 lseq corner case FAILED
    ==== Contents of test case:
    
        set tcmd {
            set res {}
            set s [catch {lindex [lseq 10 100] 0} e]
            lappend res $s $e
            set s [catch {lindex [lseq 10 9223372036854775000] 0} e]
            lappend res $s $e
            set s [catch {llength [lseq 10 9223372036854775000]} e]
            lappend res $s $e
            set s [catch {lindex [lseq 10 2147483647] 0} e]
            lappend res $s $e
            set s [catch {llength [lseq 10 2147483647]} e]
            lappend res $s $e
        }
        eval $tcmd
    
    ---- Result was:
    0 10 0 10 0 9223372036854774991 0 10 0 2147483638
    ---- Result should have been (exact matching):
    0 10 1 {max length of a Tcl list exceeded} 1 {max length of a Tcl list exceeded} 0 10 0 2147483638
    ==== lseq-4.4 FAILED
    
  5. foundin changed to: "9.0"
  6. is_private changed to: "0"
  7. login: "dgp"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Important"
  11. status changed to: "Open"
  12. submitter changed to: "dgp"
  13. subsystem changed to: "17. Commands I-L"
  14. title changed to: "multiple [lseq] test failures"
  15. type changed to: "Bug"