From 3bad046b5f5704a8ef686d5cd91cf1e2405003d2 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..c96e01309c --- /dev/null +++ b/tests/cmdline/repl_lock.py @@ -0,0 +1,7 @@ +import micropython +micropython.heap_lock() +1+1 +micropython.heap_lock() +#################################################################### +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..a7afd2ef3a --- /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() +>>> #################################################################### +>>> micropython.heap_lock() +>>> raise SystemExit