fix prettyStr stackoverflow issue, and modify test cases