test case for toLen