Tk Source Code

Check-in [6c1319b0]
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:Added more tests
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-441
Files: files | file ages | folders
SHA1:6c1319b04d632b6c6cdc5b61981c17b4eead5b15
User & Date: fvogel 2016-01-12 15:08:41
Context
2016-01-13
07:16
Typo fixed check-in: a61ce95b user: fvogel tags: tip-441
2016-01-12
15:08
Added more tests check-in: 6c1319b0 user: fvogel tags: tip-441
2016-01-11
18:00
Added some tests check-in: 6adb42a0 user: fvogel tags: tip-441
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/listbox.test.

452
453
454
455
456
457
458










































































459
460
461
462
463
464
465
} -result {-72 39 393 14}
test listbox-3.18 {ListboxWidgetCmd procedure, "bbox" option, partial last line} -constraints {
	fonts
} -body {
    mkPartial
    list [.partial.l bbox 3] [.partial.l bbox 4]
} -result {{5 56 24 14} {5 73 23 14}}










































































test listbox-3.19 {ListboxWidgetCmd procedure, "cget" option} -body {
    .l cget
} -returnCodes error -result {wrong # args: should be ".l cget option"}
test listbox-3.20 {ListboxWidgetCmd procedure, "cget" option} -body {
    .l cget a b
} -returnCodes error -result {wrong # args: should be ".l cget option"}
test listbox-3.21 {ListboxWidgetCmd procedure, "cget" option} -body {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
} -result {-72 39 393 14}
test listbox-3.18 {ListboxWidgetCmd procedure, "bbox" option, partial last line} -constraints {
	fonts
} -body {
    mkPartial
    list [.partial.l bbox 3] [.partial.l bbox 4]
} -result {{5 56 24 14} {5 73 23 14}}
test listbox-3.18a {ListboxWidgetCmd procedure, "bbox" option, justified} -constraints {
	fonts
} -setup {
    destroy .top.l .top
    unset -nocomplain res
} -body {
    toplevel .top
    listbox .top.l -justify left
    .top.l insert end Item1 LongerItem2 MuchLongerItem3
    pack .top.l
    update
    lappend res [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2]
    .top.l configure -justify center
    lappend res [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2]
    .top.l configure -justify right
    lappend res [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2]
} -cleanup {
    destroy .top.l .top
    unset -nocomplain res
} -result {
    # <TODO>
    # Results to be defined when I get my hands on a platform featuring  tcltest::testConstraints fonts == 1
    {TBD} {TBD} {TBD} {TBD} {TBD} {TBD}
}
test listbox-3.18b {ListboxWidgetCmd procedure, "bbox" option, justified, non-default borderwidth} -setup {
    destroy .top.l .top
    unset -nocomplain lres res
} -body {
    toplevel .top
    listbox .top.l -justify left -borderwidth 17 -highlightthickness 19 -selectborderwidth 22
    .top.l insert end Item1 LongerItem2 MuchLongerItem3
    .top.l selection set 1
    pack .top.l
    update
    lappend lres [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2]
    .top.l configure -justify center
    lappend lres [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2]
    .top.l configure -justify right
    lappend lres [.top.l bbox 0] [.top.l bbox 1] [.top.l bbox 2]
    set res 1
    for {set i 0} {$i < [llength $lres]} {incr i 4} {
        set res [expr {$res * [expr {[lindex $lres $i] >= 0}] }]
    }
    set res
} -cleanup {
    destroy .top.l .top
    unset -nocomplain lres res
} -result {1}
test listbox-3.18c {ListboxWidgetCmd procedure, "bbox" option, justified, selecting does not change offset} -setup {
    destroy .top.l .top
    unset -nocomplain bb1 bb2
} -body {
    toplevel .top
    listbox .top.l -justify center
    .top.l insert end Item1 Item2 Item3
    pack .top.l
    update
    set bb1 [.top.l bbox 1]
    .top.l selection set 1
    update
    set bb2 [.top.l bbox 1]
    expr {
            [lindex $bb1 0] == [lindex $bb2 0] &&
            [lindex $bb1 1] == [lindex $bb2 1] &&
            [lindex $bb1 2] == [lindex $bb2 2] &&
            [lindex $bb1 3] == [lindex $bb2 3]
         }
    # Note: the result of this test is relevant only if test listbox-3.18a
    #       succeeds first, otherwise the fact the present test listbox-3.18c
    #       passes does not mean it is OK
} -cleanup {
    destroy .top.l .top
    unset -nocomplain bb1 bb2
} -result {1}
test listbox-3.19 {ListboxWidgetCmd procedure, "cget" option} -body {
    .l cget
} -returnCodes error -result {wrong # args: should be ".l cget option"}
test listbox-3.20 {ListboxWidgetCmd procedure, "cget" option} -body {
    .l cget a b
} -returnCodes error -result {wrong # args: should be ".l cget option"}
test listbox-3.21 {ListboxWidgetCmd procedure, "cget" option} -body {