Moving segment tests to unit tests.