Segment tests only when necessary