From b701fc4005aa9bcac2fa922c63099ed6f3c36b48 Mon Sep 17 00:00:00 2001 From: fvogel Date: Tue, 24 Dec 2019 13:04:10 +0000 Subject: Add tests canvas-20.[123], currently failing and demonstrating ticket [587937fff]. --- tests/canvas.test | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/canvas.test b/tests/canvas.test index fe4c2b7..7b24a9a 100644 --- a/tests/canvas.test +++ b/tests/canvas.test @@ -950,6 +950,42 @@ test canvas-19.11 {rchars method - errors} -setup { destroy .c } -returnCodes error -result {bad index "foo"} +test canvas-20.1 {addtag/dtag - no shuffling of tag sequence} -setup { + canvas .c + .c create text 100 100 -text Hello + for {set i 1} {$i < 5} {incr i} { + .c addtag tag$i all + } +} -body { + set res [list [.c gettags 1]] + .c dtag 1 tag2 + lappend res [.c gettags 1] +} -cleanup { + destroy .c +} -result {{tag1 tag2 tag3 tag4} {tag1 tag3 tag4}} +test canvas-20.2 {tag deletion - multiple tags with same name, no shuffling} -setup { + canvas .c + .c create text 100 100 -text Hello + .c itemconfigure 1 -tags {tagA tagB tagA tagA tagC tagA} +} -body { + set res [list [.c gettags 1]] + .c dtag 1 tagA + lappend res [.c gettags 1] +} -cleanup { + destroy .c +} -result {{tagA tagB tagA tagA tagC tagA} {tagB tagC}} +test canvas-20.3 {tag deletion - all tags match} -setup { + canvas .c + .c create text 100 100 -text Hello + .c itemconfigure 1 -tags {tagA tagA tagA tagA tagA tagA} +} -body { + set res [list [.c gettags 1]] + .c dtag 1 tagA + lappend res [.c gettags 1] +} -cleanup { + destroy .c +} -result {{tagA tagA tagA tagA tagA tagA} {}} + # cleanup imageCleanup cleanupTests -- cgit v0.12