mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 04:30:24 +01:00
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:
committed by
Damien George
parent
40df95357c
commit
5b3c928f53
5
tests/cmdline/cmd_sys_exit_0.py
Normal file
5
tests/cmdline/cmd_sys_exit_0.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# cmdline:
|
||||
# test sys.exit(0) - success exit code
|
||||
import sys
|
||||
|
||||
sys.exit(0)
|
||||
1
tests/cmdline/cmd_sys_exit_0.py.exp
Normal file
1
tests/cmdline/cmd_sys_exit_0.py.exp
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
5
tests/cmdline/cmd_sys_exit_error.py
Normal file
5
tests/cmdline/cmd_sys_exit_error.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# cmdline:
|
||||
# test sys.exit() functionality and exit codes
|
||||
import sys
|
||||
|
||||
sys.exit(123)
|
||||
1
tests/cmdline/cmd_sys_exit_error.py.exp
Normal file
1
tests/cmdline/cmd_sys_exit_error.py.exp
Normal file
@@ -0,0 +1 @@
|
||||
CRASH
|
||||
5
tests/cmdline/cmd_sys_exit_none.py
Normal file
5
tests/cmdline/cmd_sys_exit_none.py
Normal file
@@ -0,0 +1,5 @@
|
||||
# cmdline:
|
||||
# test sys.exit(None) - should exit with code 0
|
||||
import sys
|
||||
|
||||
sys.exit(None)
|
||||
1
tests/cmdline/cmd_sys_exit_none.py.exp
Normal file
1
tests/cmdline/cmd_sys_exit_none.py.exp
Normal file
@@ -0,0 +1 @@
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> # tests for autocompletion
|
||||
>>> import sys
|
||||
>>> not_exist.[K[K[K[K[K[K[K[K[K[K
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> # tests for autoindent
|
||||
>>> if 1:
|
||||
... print(1)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> # basic REPL tests
|
||||
>>> print(1)
|
||||
1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> # check REPL allows to continue input
|
||||
>>> 1 \\\\
|
||||
... + 2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> # REPL tests of GNU-ish readline navigation
|
||||
>>> # history buffer navigation
|
||||
>>> 1
|
||||
|
||||
@@ -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
|
||||
>>>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> import micropython
|
||||
>>> micropython.heap_lock()
|
||||
>>> 1+1
|
||||
|
||||
@@ -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
|
||||
>>>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> # test changing ps1/ps2
|
||||
>>> import sys
|
||||
>>> sys.ps1 = "PS1"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> # word movement
|
||||
>>> # backward-word, start in word
|
||||
>>> \.\+
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> # Check for emacs keys in REPL
|
||||
>>> t = \.\+
|
||||
>>> t == 2
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
MicroPython \.\+ version
|
||||
Use \.\+
|
||||
Type "help()" for more information.
|
||||
>>> # Check for emacs keys in REPL
|
||||
>>> t = \.\+
|
||||
>>> t == 2
|
||||
|
||||
Reference in New Issue
Block a user