Skip to content

Commit 1501829

Browse files
hosakadpgeorge
authored andcommitted
tests: Add escaped quotes tests for REPL.
Test possible combinations of single and double quotes with escaped quotes and parenthesis with and without function calls in REPL. Covers: adafruit#1419
1 parent bfb272b commit 1501829

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

tests/cmdline/repl_cont.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
# check REPL allows to continue input
22
1 \
33
+ 2
4+
'"'
5+
"'"
6+
'\''
7+
"\""
8+
'\'('
9+
"\"("
10+
print("\"(")
11+
print('\'(')
12+
print("\'(")
13+
print('\"(')
414
'abc'
515
"abc"
616
'''abc

tests/cmdline/repl_cont.py.exp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,26 @@ Micro Python \.\+ version
33
>>> 1 \\\\
44
... + 2
55
3
6+
>>> '"'
7+
'"'
8+
>>> "'"
9+
"'"
10+
>>> '\\\\''
11+
"'"
12+
>>> "\\\\""
13+
'"'
14+
>>> '\\\\'('
15+
"'("
16+
>>> "\\\\"("
17+
'"('
18+
>>> print("\\\\"(")
19+
"(
20+
>>> print('\\\\'(')
21+
'(
22+
>>> print("\\\\'(")
23+
'(
24+
>>> print('\\\\"(')
25+
"(
626
>>> 'abc'
727
'abc'
828
>>> "abc"

0 commit comments

Comments
 (0)