Skip to content

Commit 8acfc23

Browse files
committed
[[ Bug 19775 ]] Fix cantDelete test
(cherry picked from commit 7d986e8)
1 parent ee46f33 commit 8acfc23

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

tests/lcs/core/interface/delete.livecodescript

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,39 @@ on TestDeleteSelectedObjects
5252
TestAssert "delete selected objects", the number of controls is 0
5353
end TestDeleteSelectedObjects
5454

55+
local sGroup
56+
5557
on TestDeleteSelectedCantDelete
5658
create stack
5759
set the defaultStack to the short name of it
5860

5961
create button
6062

61-
local tGroup
6263
create group
63-
put it into tGroup
64+
put it into sGroup
6465

65-
create field in tGroup
66-
set the cantDelete of tGroup to true
66+
create field in sGroup
67+
set the cantDelete of sGroup to true
6768

6869
select button 1
6970
delete
7071

71-
select tGroup
72-
delete
72+
TestAssertThrow "can't delete group with cantDelete true", "__TestDeleteGroup", \
73+
the long id me, "EE_OBJECT_CANTREMOVE"
7374

7475
local tThereIsAGroup
75-
put there is a tGroup into tThereIsAGroup
76+
put there is a sGroup into tThereIsAGroup
7677

7778
undo
7879

79-
TestAssert "can't delete group with cantDelete true", tThereIsAGroup
8080
TestAssert "undo previous delete after failed delete", there is a button 1
8181
end TestDeleteSelectedCantDelete
8282

83+
on __TestDeleteGroup
84+
select sGroup
85+
delete
86+
end __TestDeleteGroup
87+
8388
on TestUndoAfterDeleteNothing
8489
create stack
8590
set the defaultStack to the short name of it

0 commit comments

Comments
 (0)