This allows adding other suboptions e.g. IgnoreExtension in #137840.
Pull out common base class for formatting unit tests, removing duplicate code that accumulated over the years. Pull out macro expansion test into its own test file.