Update extract-tests.py to use same test directives as rustdoc.

Closes #11362.