From 7400d88762570b110d70752dea741fbca778818c Mon Sep 17 00:00:00 2001 From: Damien George Date: Fri, 2 Jun 2017 13:08:18 +1000 Subject: [PATCH] tests/basics/string_rsplit: Add tests for negative "maxsplit" argument. --- tests/basics/string_rsplit.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/basics/string_rsplit.py b/tests/basics/string_rsplit.py index 563b64f1c9..b92b8f359f 100644 --- a/tests/basics/string_rsplit.py +++ b/tests/basics/string_rsplit.py @@ -52,3 +52,7 @@ print("/*10/*11/*12/*".rsplit("/*", 4)) print("/*10/*11/*12/*".rsplit("/*", 5)) print(b"abcabc".rsplit(b"bc", 2)) + +# negative "maxsplit" should delegate to .split() +print('abaca'.rsplit('a', -1)) +print('abaca'.rsplit('a', -2))