Tcl Source Code

Check-in [9979924a94]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Bring back test-cases closer to what they were
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-514
Files: files | file ages | folders
SHA3-256:9979924a940c6ab9d811c7b00dc77b7143a4a754964a50aeed7f085d64a92516
User & Date: jan.nijtmans 2018-09-08 21:34:48
Original Comment: Bring back test-cases closes to what they were
Context
2018-09-08
21:49
TCL_NUMBER_WIDE -> TCL_NUMBER_INT. Two test-cases still failing check-in: c54622966e user: jan.nijtmans tags: tip-514
21:34
Bring back test-cases closer to what they were check-in: 9979924a94 user: jan.nijtmans tags: tip-514
21:29
Merge TIP-515 branch, so part of the corrections in the TIP-514 implementation branch now moved to t... check-in: 3e36e66ffe user: jan.nijtmans tags: tip-514
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/scan.test.

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
...
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# procedure that returns the range of integers

proc int_range {} {
    set MAX_INT [expr {[format %lu -2]/2}]
    set MIN_INT [expr { ~ $MAX_INT }]
    return [list $MIN_INT $MAX_INT]
}

# Big test for correct ordering of data in [expr]

proc testIEEE {} {
................................................................................
} -cleanup {
    unset -nocomplain y
    unset -nocomplain z
} -result {1 {can't set "z": variable is array} abc}

test scan-4.62 {scanning of large and negative octal integers} {
    lassign [int_range] MIN_INT MAX_INT
    set scanstring [format {%lo %lo %lo} -1 $MIN_INT $MAX_INT]
    list [scan $scanstring {%lo %lo %lo} a b c] \
	[expr { $a == -1 }] [expr { $b == $MIN_INT }] [expr { $c == $MAX_INT }]
} {3 1 1 1}
test scan-4.63 {scanning of large and negative hex integers} {
    lassign [int_range] MIN_INT MAX_INT
    set scanstring [format {%lx %lx %lx} -1 $MIN_INT $MAX_INT]
    list [scan $scanstring {%lx %lx %lx} a b c] \
	[expr { $a == -1 }] [expr { $b == $MIN_INT }] [expr { $c == $MAX_INT }]
} {3 1 1 1}
test scan-4.64 {scanning of hex with %X} {
    scan "123 abc f78" %X%X%X
} {291 2748 3960}

test scan-5.1 {integer scanning} -setup {







|







 







|
|




|
|







15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
...
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
    package require tcltest 2
    namespace import -force ::tcltest::*
}

# procedure that returns the range of integers

proc int_range {} {
    set MAX_INT [expr {[format %u -2]/2}]
    set MIN_INT [expr { ~ $MAX_INT }]
    return [list $MIN_INT $MAX_INT]
}

# Big test for correct ordering of data in [expr]

proc testIEEE {} {
................................................................................
} -cleanup {
    unset -nocomplain y
    unset -nocomplain z
} -result {1 {can't set "z": variable is array} abc}

test scan-4.62 {scanning of large and negative octal integers} {
    lassign [int_range] MIN_INT MAX_INT
    set scanstring [format {%o %o %o} -1 $MIN_INT $MAX_INT]
    list [scan $scanstring {%o %o %o} a b c] \
	[expr { $a == -1 }] [expr { $b == $MIN_INT }] [expr { $c == $MAX_INT }]
} {3 1 1 1}
test scan-4.63 {scanning of large and negative hex integers} {
    lassign [int_range] MIN_INT MAX_INT
    set scanstring [format {%x %x %x} -1 $MIN_INT $MAX_INT]
    list [scan $scanstring {%x %x %x} a b c] \
	[expr { $a == -1 }] [expr { $b == $MIN_INT }] [expr { $c == $MAX_INT }]
} {3 1 1 1}
test scan-4.64 {scanning of hex with %X} {
    scan "123 abc f78" %X%X%X
} {291 2748 3960}

test scan-5.1 {integer scanning} -setup {