Consistently use `constexpr StringRef Code("string literal");`.
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.
Also add line range examples from #58161. Differential Revision: https://reviews.llvm.org/D136658