Add test for adding new segment. [ci skip]