Rather than making these mutable global state, I'd still prefer if you simply made it possible to pass in test data to your parsing functions directly and kept these const. That way the inputs and outputs of what you are testing are very clear.