spec_tests.py: make --dump-tests sensitive to --pattern, --number.

Closes #249 in a slightly different way.