26 lines
454 B
Python
26 lines
454 B
Python
from comm import *
|
|
|
|
# These require a connection!
|
|
def test_print_char():
|
|
p = Program()
|
|
p.parse_asm_line(f"SENDVAL 100")
|
|
assert connect_exec(p) == b'100'
|
|
|
|
def test_print_string():
|
|
p = Program()
|
|
p.parse_lines([
|
|
"j .l",
|
|
f"db d0 {[ord(x) for x in 'hello world']}",
|
|
".l",
|
|
"senddat d0"
|
|
])
|
|
return connect_exec(p).decode()
|
|
|
|
def test_run_adc():
|
|
p = Program()
|
|
p.parse_lines([
|
|
"read_adc 0 r0",
|
|
"sendval r0"
|
|
])
|
|
return connect_exec(p).decode()
|