Add tests for ranges merge