Repository navigation
Closed
Description
I attempted to refactor tests into their own file, main.py. This works in CPython but not in LPython
repro: https://github.com/rebcabin/lpython/tree/brian-lasr/lasr/LP-pycharm/Issue2032
offending code:
from lasr_stringio import StringIO, __post_init__
from lasr_lexer import stringio_test, regex_test, lexer_test
if __name__ == '__main__':
integer_asr : str = '(Integer 4 [])'
fd : StringIO = StringIO(integer_asr)
__post_init__(fd) # Issue #1929
stringio_test(fd, integer_asr)
regex_test()
lexer_test() # lexer)run:
# CPYTHON
(lp) ┌─(~/CLionProjects/lpython/lasr/LP-pycharm/Issue2032)───────────────────────────────────────────────────────────────────────────────────────────────(brian@Golf37:s012)─┐
└─(17:22:20 on brian-lasr ✭)──> PYTHONPATH='../../../src/runtime/lpython' python main.py ──(Sun,Jun25)─┘
STRINGIO TEST
READ-SEEK-TELL-TEST
REGEX TEST
LEXER TEST
# LPYTHON
(lp) ┌─(~/CLionProjects/lpython/lasr/LP-pycharm/Issue2032)───────────────────────────────────────────────────────────────────────────────────────────────(brian@Golf37:s012)─┐
└─(17:22:25 on brian-lasr ✭)──> ~/CLionProjects/lpython/src/bin/lpython -I. main.py ──(Sun,Jun25)─┘
semantic error: Type mismatch in procedure call; the types must be compatible
--> main.py:11:19
|
11 | stringio_test(fd, integer_asr)
| ^^ type mismatch (passed argument type is StringIO but required type is StringIO)
--> ./lasr_lexer.py:29:30
|
29 | def stringio_test(fd : InOut[StringIO], integer_asr : str):
| ^^^^^^^^ type mismatch (passed argument type is StringIO but required type is StringIO)Metadata
Metadata
Assignees
Labels
No labels
Activity
TEST: Add test for issue lcompilers#2032
TEST: Add test for issue lcompilers#2032