Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2022-10-06
10:27 • Closed ticket [9c3663977b]: multiple lseq test failures plus 6 other chang... artifact: 9da831ed2b user: jan.nijtmans
2022-09-28
12:16 • New ticket [9c3663977b]. artifact: ddae1102c8 user: dgp

multiple [lseq] test failures

Closed / Fixed9c3663977bd4216db965eb418f99dfc4d7af4e8aCreated 4 years agoUpdated 4 years ago
Descriptionplain2022-09-28 12:16:37
==== 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
jan.nijtmanswiki2022-10-06 10:27:22

Fixed now, at least since [5a5bf81d4c384f25]

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