Tk Source Code

Check-in [c8bf1bce]
Login

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

Overview
Comment:winfo.test: add tests for "winfo interps" with multiple interpreters (in the same process and in different processes)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | bug-9ba9729ef1
Files: files | file ages | folders
SHA3-256: c8bf1bce91f5e97fe7321ec4ff2fdb7f98e26f410342f3ca99978012cc9cabee
User & Date: erikleunissen 2025-08-16 10:05:17.537
Context
2025-08-16
20:05
Let tests be run at Github CI for this branch check-in: dd5d0ddc user: erikleunissen tags: bug-9ba9729ef1
10:05
winfo.test: add tests for "winfo interps" with multiple interpreters (in the same process and in different processes) check-in: c8bf1bce user: erikleunissen tags: bug-9ba9729ef1
09:09
Fix mistake in previous commit check-in: 95d7944f user: erikleunissen tags: bug-9ba9729ef1
Changes
Unified Diff Ignore Whitespace Patch
Changes to tests/winfo.test.
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

package require tcltest 2.2
namespace import ::tcltest::*
tcltest::configure {*}$argv
tcltest::loadTestedCommands

# Import utility procs for specific functional areas
testutils import colors

# XXX - This test file is woefully incomplete.  At present, only a
# few of the winfo options are tested.

# ----------------------------------------------------------------------

test winfo-1.1 {"winfo atom" command} -body {







|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22

package require tcltest 2.2
namespace import ::tcltest::*
tcltest::configure {*}$argv
tcltest::loadTestedCommands

# Import utility procs for specific functional areas
testutils import child colors

# XXX - This test file is woefully incomplete.  At present, only a
# few of the winfo options are tested.

# ----------------------------------------------------------------------

test winfo-1.1 {"winfo atom" command} -body {
166
167
168
169
170
171
172



























173
174
175
176
177
178
179
} -returnCodes error -result {bad window path name "geek"}
test winfo-5.4 {"winfo interps" command} -constraints unix -body {
    expr {[lsearch -exact [winfo interps] [tk appname]] >= 0}
} -result 1
test winfo-5.5 {"winfo interps" command} -constraints unix -body {
    expr {[lsearch -exact [winfo interps -displayof .] [tk appname]] >= 0}
} -result 1





























test winfo-6.1 {"winfo exists" command} -body {
    winfo exists
} -returnCodes error -result {wrong # args: should be "winfo exists window"}
test winfo-6.2 {"winfo exists" command} -body {
    winfo exists a b







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







166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
} -returnCodes error -result {bad window path name "geek"}
test winfo-5.4 {"winfo interps" command} -constraints unix -body {
    expr {[lsearch -exact [winfo interps] [tk appname]] >= 0}
} -result 1
test winfo-5.5 {"winfo interps" command} -constraints unix -body {
    expr {[lsearch -exact [winfo interps -displayof .] [tk appname]] >= 0}
} -result 1
test winfo-5.6 {"winfo interps" command, two interps, same process} -constraints unix -setup {
    childTkInterp child
    tk appname tktest
} -body {
    child eval {tk appname foo}
    lsort [winfo interps]
} -result {foo tktest} -cleanup {
    interp delete child
}
test winfo-5.7.1 {"winfo interps" command, two interps, different processes} -constraints {unix notAqua} -setup {
    tk appname tktest
    childTkProcess create
} -body {
    childTkProcess eval {tk appname foo}
    lsort [winfo interps]
} -result {foo tktest} -cleanup {
    childTkProcess exit
}
test winfo-5.7.2 {"winfo interps" command, two interps, different processes} -constraints aqua -setup {
    tk appname tktest
    childTkProcess create
} -body {
    childTkProcess eval {tk appname foo}
    lsort [winfo interps]
} -result foo -cleanup {
    childTkProcess exit
}


test winfo-6.1 {"winfo exists" command} -body {
    winfo exists
} -returnCodes error -result {wrong # args: should be "winfo exists window"}
test winfo-6.2 {"winfo exists" command} -body {
    winfo exists a b
463
464
465
466
467
468
469
470
471
472
473
474
475
476
} -result 1

#
# CLEANUP
#

deleteWindows
testutils forget colors
cleanupTests
return

# Local variables:
# mode: tcl
# End:







|






490
491
492
493
494
495
496
497
498
499
500
501
502
503
} -result 1

#
# CLEANUP
#

deleteWindows
testutils forget child colors
cleanupTests
return

# Local variables:
# mode: tcl
# End: