Add tests for source positions and parse flags