Skip to reading
Debugging and Performance Profiling

Turn an expected result into a test

Edition 0.86.4.7

0.86.4.7 tutorial edition with new lessons for Studio 0.86.4.6 and 0.86.4.7. Earlier chapters, screenshots and registry figures retain their stated edition context.

Download PDFView illustrations

REGRESSION TESTS / DEBUG & PROFILE

Saved test details and the three passing workbench cases in PCA.

1. Open Regression tests and choose Run all. Each of the three workbench scripts should return 60. A fresh game instance supplies each test’s starting variables.

2. Select one case, enable Check return value, enter 61 in Expected return and choose Run selected. The failure should show both the expected 61 and the actual 60. Restore 60 and rerun.

3. Choose New for your own script. Give the test a name, language, script ID and function. Supply an array of arguments. For a variable-driven puzzle enter starting globals such as {"tickets":2} and expected globals such as {"paid":1}. Choose Record expectations to run the script and fill in its observed return and changed globals. Review them, then choose Save test.

Keep it reproducible#

Save test stores the case in the open project. Save the project to disk. Run selected saves the current case and runs it. Run all uses the cases already saved in the project.

Contents                                                                                     15 / 16

0.86.4.7 | Related lesson: Save a repeatable script test. Open p. 18 >

Page 15 of 19Permalink
Go to page