Test a function: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: added invoke test_summary() note.)
m (→‎{{header|Phix}}: added output comment)
Line 1,569: Line 1,569:
unless set_test_abort() other than TEST_QUIET is in force. You can of course invoke these routines in a platform-dependent <br>
unless set_test_abort() other than TEST_QUIET is in force. You can of course invoke these routines in a platform-dependent <br>
way, for instance pause on the desktop but abort/stop completely in the browser, should that help.
way, for instance pause on the desktop but abort/stop completely in the browser, should that help.

Should you invoke a bunch of tests but forget the final test_summary(), then apart from set_test_abort(TEST_CRASH) any
failures ''will'' slip by completely unnoticed.
{{out}}
{{out}}
The following shows example output from various set_test_verbosity() settings, with and without any failures.

TEST_QUIET with a failing test (no output or pause if no failing tests)<br>
TEST_QUIET with a failing test (no output or pause if no failing tests)<br>
TEST_SUMMARY with a failure, same output
TEST_SUMMARY with a failure, same output
Line 1,578: Line 1,583:
Press any key to continue...
Press any key to continue...
</pre>
</pre>
TEST_SUMMARY with no failure (and w/o set_test_pause(1))<br>
TEST_SUMMARY with no failure (and without set_test_pause(TEST_PAUSE))<br>
TEST_SHOW_FAILED with no failure, ditto
TEST_SHOW_FAILED with no failure, ditto
<pre>
<pre>
Line 1,603: Line 1,608:
Press any key to continue...
Press any key to continue...
</pre>
</pre>
TEST_SHOW_ALL with no failure (and w/o set_test_pause(TEST_PAUSE))
TEST_SHOW_ALL with no failure (and without set_test_pause(TEST_PAUSE))
<pre>
<pre>
palindromes:
palindromes: