Testing get_segment function