summaryrefslogtreecommitdiff
path: root/tests/micropython/heapalloc_str.py
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-01-27 00:45:30 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2017-01-27 00:49:39 +0300
commit9ffc3ae0e7355c69af212ba918c90ef9cb57be7b (patch)
tree7ca97754a144dee303adcff20c226528822b0eea /tests/micropython/heapalloc_str.py
parente2e663291dd1408cc9c5118d258a568470e32f8c (diff)
tests/heapalloc_str: Test for alloc-free string operations.
Starts with concatenation with an empty string.
Diffstat (limited to 'tests/micropython/heapalloc_str.py')
-rw-r--r--tests/micropython/heapalloc_str.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/micropython/heapalloc_str.py b/tests/micropython/heapalloc_str.py
new file mode 100644
index 000000000..0df39d3c0
--- /dev/null
+++ b/tests/micropython/heapalloc_str.py
@@ -0,0 +1,14 @@
+# String operations which don't require allocation
+import micropython
+
+micropython.heap_lock()
+
+b"" + b""
+b"" + b"1"
+b"2" + b""
+
+"" + ""
+"" + "1"
+"2" + ""
+
+micropython.heap_unlock()