This copies the test code inline into the Markdown, which means it could diverge from the test code which is compiled and run as part of the tests. That needs improving, but that can happen in a subsequent commit. Helps: #3037