Author: Nate Bragg <n...@cs.tufts.edu> Branch: lstrip_to_empty_string Changeset: r90833:835b7eebd891 Date: 2017-03-28 07:07 -0400 http://bitbucket.org/pypy/pypy/changeset/835b7eebd891/
Log: Failing test showing that lstrip doesn`t consume a whole string. diff --git a/rpython/rtyper/test/test_rstr.py b/rpython/rtyper/test/test_rstr.py --- a/rpython/rtyper/test/test_rstr.py +++ b/rpython/rtyper/test/test_rstr.py @@ -459,6 +459,8 @@ return const(' ').strip(' ') def left2(): return const('a ').strip(' ') + def leftall(): + return const('!!').lstrip(const('!')) res = self.interpret(both, []) assert self.ll_to_string(res) == const('ab') res = self.interpret(left, []) @@ -469,6 +471,8 @@ assert self.ll_to_string(res) == const('') res = self.interpret(left2, []) assert self.ll_to_string(res) == const('a') + res = self.interpret(leftall, []) + assert self.ll_to_string(res) == const('') def test_strip_multiple_chars(self): const = self.const @@ -482,6 +486,8 @@ return const(' \t\t ').strip('\t ') def left2(): return const('a ').strip(' \t') + def leftall(): + return const('!ab!').lstrip(const('!ab')) res = self.interpret(both, []) assert self.ll_to_string(res) == const('b') res = self.interpret(left, []) @@ -492,6 +498,8 @@ assert self.ll_to_string(res) == const('') res = self.interpret(left2, []) assert self.ll_to_string(res) == const('a') + res = self.interpret(leftall, []) + assert self.ll_to_string(res) == const('') def test_upper(self): const = self.const _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit