Fixed #23768 -- Rewrote template tests as unit tests

I wonder the same thing. In order to parallel the old suite, each test is run six times with the combinations documented in the setup function. This may very well be overkill.

I'm happy to add separate test cases for debug and invalid string, and possible the cached loader, if we decide to do that.