added tests for segment