= Exercise 5.19
// Refs:
:url-base: https://github.com/fenegroni/TGPL-exercise-solutions
:workflow: workflows/Exercise 5.19
:action: actions/workflows/ch5ex19.yml
:url-workflow: {url-base}/{workflow}
:url-action: {url-base}/{action}
:badge-exercise: image:{url-workflow}/badge.svg?branch=main[link={url-action}]
{badge-exercise}
Use `panic` and `recover` to write a function that contains no `return` statement
yet returns a non-zero value.
== Test
Because a function with a return value will not compile if it does not contain a return statement,
the test will validate that `panic` was called by comparing the result of `recover` to a known value.
=== No return
The function under test `NoReturnStatement` receives an argument and
calls `panic` with that argument.
`TestNoReturnStatement` calls `NoReturnStatement` with a known value and
checks that `recover` returns that argument.