parse optstring with unit test