From 4a4bb84e9216a130050a13e20a19fbf476ed6e6c Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 22 Mar 2017 22:17:52 +0300 Subject: [PATCH] tests/heapalloc_str: Test no-replacement case for str.replace(). --- tests/micropython/heapalloc_str.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/micropython/heapalloc_str.py b/tests/micropython/heapalloc_str.py index 0df39d3c0c..39aa56ccd7 100644 --- a/tests/micropython/heapalloc_str.py +++ b/tests/micropython/heapalloc_str.py @@ -3,6 +3,7 @@ import micropython micropython.heap_lock() +# Concatenating empty string returns original string b"" + b"" b"" + b"1" b"2" + b"" @@ -11,4 +12,7 @@ b"2" + b"" "" + "1" "2" + "" +# If no replacements done, returns original string +"foo".replace(",", "_") + micropython.heap_unlock()