Tk Source Code

Check-in [8213d743]
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:Test text-11a.41 now correctly written passes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | tip-438
Files: files | file ages | folders
SHA1:8213d743e26d777b68036bd00b93ab9bfe6fe3f9
User & Date: fvogel 2015-12-20 22:16:36
Context
2015-12-21
12:12
Merged core-8-5-branch check-in: a888e911 user: fvogel tags: tip-438
2015-12-20
22:16
Test text-11a.41 now correctly written passes. check-in: 8213d743 user: fvogel tags: tip-438
22:09
There could be false negatives with [.text pendingsync] when line metrics calculation is in the middle of a long line. check-in: 5fc26426 user: fvogel tags: tip-438
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tests/text.test.

1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122

1123

1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
    pack [text .top.yt]
    set content {}
    for {set i 1} {$i < 300} {incr i} {
        append content [string repeat "$i " 50] \n
    }
    bind .top.yt <<WidgetViewSync>> {lappend res Sync:%d}
    .top.yt insert 1.0 $content
    update
    # ensure the test is relevant
    lappend res [.top.yt pendingsync]
    # - there is no more any pending sync after running 'sync'
    # - <<WidgetViewSync>> fires when sync returns if there was pending syncs 

    .top.yt sync

    lappend res [.top.yt pendingsync]
    update
    set res
} -cleanup {
    destroy .top.yt .top
} -result {Sync:0 1 0 Sync:1}

# edit, mark, scan, search, see, tag, window, xview and yview actions are tested elsewhere.

test text-12.1 {ConfigureText procedure} {
    list [catch {.t2 configure -state foobar} msg] $msg
} {1 {bad state "foobar": must be disabled or normal}}
test text-12.2 {ConfigureText procedure} {







|

|
<

>

>
|
<



|







1111
1112
1113
1114
1115
1116
1117
1118
1119
1120

1121
1122
1123
1124
1125

1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
    pack [text .top.yt]
    set content {}
    for {set i 1} {$i < 300} {incr i} {
        append content [string repeat "$i " 50] \n
    }
    bind .top.yt <<WidgetViewSync>> {lappend res Sync:%d}
    .top.yt insert 1.0 $content
    vwait res  ; # event dealt with by the event loop, with %d==0 i.e. we're out of sync
    # ensure the test is relevant
    lappend res "Pending:[.top.yt pendingsync]"

    # - <<WidgetViewSync>> fires when sync returns if there was pending syncs 
    # - there is no more any pending sync after running 'sync'
    .top.yt sync
    vwait res  ; # event dealt with by the event loop, with %d==1 i.e. we're in sync again
    lappend res "Pending:[.top.yt pendingsync]"

    set res
} -cleanup {
    destroy .top.yt .top
} -result {Sync:0 Pending:1 Sync:1 Pending:0}

# edit, mark, scan, search, see, tag, window, xview and yview actions are tested elsewhere.

test text-12.1 {ConfigureText procedure} {
    list [catch {.t2 configure -state foobar} msg] $msg
} {1 {bad state "foobar": must be disabled or normal}}
test text-12.2 {ConfigureText procedure} {