Add tests for text substitution