Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/cmdline/cmd_parsetree.py.exp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
id(g)
int(123)
----------------
File cmdline/cmd_parsetree.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmdline/cmd_parsetree.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand Down
24 changes: 12 additions & 12 deletions tests/cmdline/cmd_showbc.py.exp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File cmdline/cmd_showbc.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block '<module>' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand Down Expand Up @@ -34,7 +34,7 @@ arg names:
\\d\+ IMPORT_STAR
\\d\+ LOAD_CONST_NONE
\\d\+ RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+rg names:
Expand Down Expand Up @@ -312,7 +312,7 @@ Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
\\d\+ RETURN_VALUE
\\d\+ LOAD_CONST_SMALL_INT 1
\\d\+ RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+rg names:
Expand Down Expand Up @@ -367,7 +367,7 @@ Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
48 POP_TOP
49 LOAD_CONST_NONE
50 RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand All @@ -385,7 +385,7 @@ arg names: a
\\d\+ STORE_FAST 1
\\d\+ LOAD_CONST_NONE
\\d\+ RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand All @@ -409,7 +409,7 @@ arg names:
10 POP_TOP
11 LOAD_CONST_NONE
12 RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'Class' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block 'Class' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand All @@ -425,7 +425,7 @@ arg names:
10 STORE_NAME __qualname__
13 LOAD_CONST_NONE
14 RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand All @@ -442,7 +442,7 @@ arg names: self
\\d\+ POP_TOP
\\d\+ LOAD_CONST_NONE
\\d\+ RETURN_VALUE
File cmdline/cmd_showbc.py, code block '<genexpr>' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block '<genexpr>' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand All @@ -466,7 +466,7 @@ arg names: * * *
17 JUMP 4
20 LOAD_CONST_NONE
21 RETURN_VALUE
File cmdline/cmd_showbc.py, code block '<listcomp>' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block '<listcomp>' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand All @@ -487,7 +487,7 @@ arg names: * * *
15 STORE_COMP 20
17 JUMP 4
20 RETURN_VALUE
File cmdline/cmd_showbc.py, code block '<dictcomp>' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block '<dictcomp>' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand All @@ -508,7 +508,7 @@ arg names: * * *
17 STORE_COMP 25
19 JUMP 4
22 RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'closure' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block 'closure' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand All @@ -527,7 +527,7 @@ arg names: *
08 DELETE_DEREF 0
10 LOAD_CONST_NONE
11 RETURN_VALUE
File cmdline/cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
File \.\*cmd_showbc.py, code block 'f' (descriptor: \.\+, bytecode @\.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
########
\.\+63
Expand Down
2 changes: 1 addition & 1 deletion tests/cmdline/cmd_verbose.py.exp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
File cmdline/cmd_verbose.py, code block '<module>' (descriptor: \.\+, bytecode \.\+ bytes)
File \.\*cmd_verbose.py, code block '<module>' (descriptor: \.\+, bytecode \.\+ bytes)
Raw bytecode (code_info_size=\\d\+, bytecode_size=\\d\+):
08 \.\+
########
Expand Down
2 changes: 1 addition & 1 deletion tests/cmdline/repl_micropyinspect.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# cmdline: cmdline/repl_micropyinspect
# cmdline: ./cmdline/repl_micropyinspect
# setting MICROPYINSPECT environment variable before program exit triggers REPL
2 changes: 1 addition & 1 deletion tests/cmdline/repl_micropyinspect.py.exp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
MicroPython \.\+ version
Use \.\+
>>> # cmdline: cmdline/repl_micropyinspect
>>> # cmdline: ./cmdline/repl_micropyinspect
>>> # setting MICROPYINSPECT environment variable before program exit triggers REPL
>>>
20 changes: 10 additions & 10 deletions tests/io/file1.py
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
f = open("io/data/file1")
f = open("data/file1")
print(f.read(5))
print(f.readline())
print(f.read())
f = open("io/data/file1")
f = open("data/file1")
print(f.readlines())
f = open("io/data/file1", "r")
f = open("data/file1", "r")
print(f.readlines())
f = open("io/data/file1", "rb")
f = open("data/file1", "rb")
print(f.readlines())
f = open("io/data/file1", mode="r")
f = open("data/file1", mode="r")
print(f.readlines())
f = open("io/data/file1", mode="rb")
f = open("data/file1", mode="rb")
print(f.readlines())

# write() error
f = open("io/data/file1", "r")
f = open("data/file1", "r")
try:
f.write("x")
except OSError:
print("OSError")
f.close()

# read(n) error on binary file
f = open("io/data/file1", "ab")
f = open("data/file1", "ab")
try:
f.read(1)
except OSError:
print("OSError")
f.close()

# read(n) error on text file
f = open("io/data/file1", "at")
f = open("data/file1", "at")
try:
f.read(1)
except OSError:
print("OSError")
f.close()

# read() w/o args error
f = open("io/data/file1", "ab")
f = open("data/file1", "ab")
try:
f.read()
except OSError:
Expand Down
2 changes: 1 addition & 1 deletion tests/io/file_iter.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
f = open("io/data/file1")
f = open("data/file1")
for l in f:
print(l)
2 changes: 1 addition & 1 deletion tests/io/file_long_read.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
f = open("io/data/file1")
f = open("data/file1")
b = f.read(100)
print(len(b))
2 changes: 1 addition & 1 deletion tests/io/file_long_read2.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
f = open("io/data/bigfile1")
f = open("data/bigfile1")
b = f.read()
print(len(b))
print(b)
2 changes: 1 addition & 1 deletion tests/io/file_long_read3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
f = open("io/data/bigfile1", "rb")
f = open("data/bigfile1", "rb")
b = f.read(512)
print(len(b))
print(b)
6 changes: 3 additions & 3 deletions tests/io/file_readinto.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
b = bytearray(30)
f = open("io/data/file1", "rb")
f = open("data/file1", "rb")
print(f.readinto(b))
print(b)
f = open("io/data/file2", "rb")
f = open("data/file2", "rb")
print(f.readinto(b))
print(b)

# readinto() on writable file
f = open("io/data/file1", "ab")
f = open("data/file1", "ab")
try:
f.readinto(bytearray(4))
except OSError:
Expand Down
4 changes: 2 additions & 2 deletions tests/io/file_readinto_len.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
b = bytearray(30)
f = open("io/data/file1", "rb")
f = open("data/file1", "rb")
# 2nd arg (length to read) is extension to CPython
print(f.readinto(b, 8))
print(b)

b = bytearray(4)
f = open("io/data/file1", "rb")
f = open("data/file1", "rb")
print(f.readinto(b, 8))
print(b)
4 changes: 2 additions & 2 deletions tests/io/file_readline.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
f = open("io/data/file1")
f = open("data/file1")
print(f.readline())
print(f.readline(3))
print(f.readline(4))
print(f.readline(5))
print(f.readline())

# readline() on writable file
f = open("io/data/file1", "ab")
f = open("data/file1", "ab")
try:
f.readline()
except OSError:
Expand Down
6 changes: 3 additions & 3 deletions tests/io/file_seek.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
f = open("io/data/file1", "rb")
f = open("data/file1", "rb")
print(f.seek(6))
print(f.read(5))
print(f.tell())
Expand All @@ -18,14 +18,14 @@
f.close()

# test text mode
f = open("io/data/file1", "rt")
f = open("data/file1", "rt")
print(f.seek(6))
print(f.read(5))
print(f.tell())
f.close()

# seek closed file
f = open("io/data/file1", "r")
f = open("data/file1", "r")
f.close()
try:
f.seek(1)
Expand Down
2 changes: 1 addition & 1 deletion tests/io/file_with.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
f = open("io/data/file1")
f = open("data/file1")

with f as f2:
print(f2.read())
Expand Down
Loading