From a791f7f43ccc21f4275e3905240e61cf5bfa1c0c Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 20 Aug 2025 17:29:45 -0500 Subject: [PATCH] tests: Add test for heap lock in REPL. Signed-off-by: Jeff Epler --- tests/cmdline/repl_lock.py | 7 +++++++ tests/cmdline/repl_lock.py.exp | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/cmdline/repl_lock.py create mode 100644 tests/cmdline/repl_lock.py.exp diff --git a/tests/cmdline/repl_lock.py b/tests/cmdline/repl_lock.py new file mode 100644 index 0000000000..77e2e93274 --- /dev/null +++ b/tests/cmdline/repl_lock.py @@ -0,0 +1,7 @@ +import micropython +micropython.heap_lock() +1+1 +micropython.heap_lock() +None # Cause the repl's line storage to be enlarged ---------------- +micropython.heap_lock() +raise SystemExit diff --git a/tests/cmdline/repl_lock.py.exp b/tests/cmdline/repl_lock.py.exp new file mode 100644 index 0000000000..7cce24f6c6 --- /dev/null +++ b/tests/cmdline/repl_lock.py.exp @@ -0,0 +1,10 @@ +MicroPython \.\+ version +Use \.\+ +>>> import micropython +>>> micropython.heap_lock() +>>> 1+1 +2 +>>> micropython.heap_lock() +>>> None # Cause the repl's line storage to be enlarged ---------------- +>>> micropython.heap_lock() +>>> raise SystemExit