Add tests for the new optinal match implementation