unix/main: Use standard pyexec REPL for unix and windows ports.

This improves REPL usage consistency across ports, by utilizing the pyexec
code for the unix REPL.

Only enabled when MICROPY_USE_READLINE == 1 (the default).

Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
This commit is contained in:
Andrew Leech
2023-10-26 09:02:16 +11:00
committed by Damien George
parent 40df95357c
commit 5b3c928f53
25 changed files with 59 additions and 89 deletions

View File

@@ -0,0 +1,5 @@
# cmdline:
# test sys.exit(0) - success exit code
import sys
sys.exit(0)

View File

@@ -0,0 +1 @@

View File

@@ -0,0 +1,5 @@
# cmdline:
# test sys.exit() functionality and exit codes
import sys
sys.exit(123)

View File

@@ -0,0 +1 @@
CRASH

View File

@@ -0,0 +1,5 @@
# cmdline:
# test sys.exit(None) - should exit with code 0
import sys
sys.exit(None)

View File

@@ -0,0 +1 @@

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # tests for autocompletion
>>> import sys
>>> not_exist.

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use Ctrl-D to exit, Ctrl-E for paste mode
Type "help()" for more information.
>>> # Test REPL autocompletion filtering of underscore attributes
>>>
>>> # Start paste mode

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # tests for autoindent
>>> if 1:
... print(1)

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # basic REPL tests
>>> print(1)
1

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # check REPL allows to continue input
>>> 1 \\\\
... + 2

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # REPL tests of GNU-ish readline navigation
>>> # history buffer navigation
>>> 1

View File

@@ -1,6 +1,6 @@
test
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # cmdline: -i -c print("test")
>>> # -c option combined with -i option results in REPL
>>>

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> import micropython
>>> micropython.heap_lock()
>>> 1+1

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # cmdline: cmdline/repl_micropyinspect
>>> # setting MICROPYINSPECT environment variable before program exit triggers REPL
>>>

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use Ctrl-D to exit, Ctrl-E for paste mode
Type "help()" for more information.
>>> # Test REPL paste mode functionality
>>>
>>> # Basic paste mode with a simple function

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # test changing ps1/ps2
>>> import sys
>>> sys.ps1 = "PS1"

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # word movement
>>> # backward-word, start in word
>>> \.\+

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # Check for emacs keys in REPL
>>> t = \.\+
>>> t == 2

View File

@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
Type "help()" for more information.
>>> # Check for emacs keys in REPL
>>> t = \.\+
>>> t == 2