diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-30 03:11:44 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-05-30 03:15:17 +0300 |
commit | 8827682b35f6fefb4604f28447b77e8443cbf1cb (patch) | |
tree | 6dc258faa2d577dc893f231fc19ff53ac6b2127e /tests | |
parent | bcdffe53c641ad5832f06cd544f29e3cdd522829 (diff) | |
download | micropython-8827682b35f6fefb4604f28447b77e8443cbf1cb.tar.gz micropython-8827682b35f6fefb4604f28447b77e8443cbf1cb.zip |
objstr: *strip(): If nothing is stripped, don't create dup string.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/string_strip.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/basics/string_strip.py b/tests/basics/string_strip.py index 70c74b3834..5d99a78e51 100644 --- a/tests/basics/string_strip.py +++ b/tests/basics/string_strip.py @@ -31,3 +31,7 @@ print(" a".rstrip()) print("a ".strip()) print("a ".lstrip()) print("a ".rstrip()) + +# Test that stripping unstrippable string returns original object +s = "abc" +print(id(s.strip()) == id(s)) |