Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit dba7cb4

Browse filesBrowse files
committed
[[ Tests ]] Add test for lcb throw in widget OnCreate
1 parent bfd5d7e commit dba7cb4
Copy full SHA for dba7cb4

File tree

Expand file treeCollapse file tree

2 files changed

+26
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+26
-0
lines changed
Open diff view settings
Collapse file
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
widget com.livecode.lcs_tests.core.widgetthrow
2+
3+
public handler OnCreate() returns nothing
4+
throw "error"
5+
end handler
6+
7+
end widget
Collapse file

‎tests/lcs/core/engine/widget.livecodescript‎

Copy file name to clipboardExpand all lines: tests/lcs/core/engine/widget.livecodescript
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
2121
on TestSetup
2222
TestLoadAuxillaryExtension "_widget"
2323
TestLoadAuxillaryExtension "_widget_support"
24+
TestLoadAuxillaryExtension "_widgetthrow"
2425
end TestSetup
2526

2627
//////////
@@ -80,3 +81,21 @@ end TestWidgetScriptObjectAccess
8081
on errorDialog pError
8182
put pError into gLastSentWidgetError
8283
end errorDialog
84+
85+
//////////
86+
87+
on TestWidgetThrowInOnCreate
88+
set the lockErrorDialogs to true
89+
create stack "WidgetThrowOnSaveTest"
90+
set the defaultStack to "WidgetThrowOnSaveTest"
91+
92+
put empty into gLastSentWidgetError
93+
94+
create widget "Test" as "com.livecode.lcs_tests.core.widgetthrow"
95+
96+
wait for 0 with messages
97+
98+
delete stack "WidgetThrowOnSaveTest"
99+
TestAssert "error dialog when widget throws in OnCreate", \
100+
gLastSentWidgetError is not empty
101+
end TestWidgetThrowInOnCreate

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.