Skip to content

Commit

Permalink
[Phase4] Optimize test.py
Browse files Browse the repository at this point in the history
  • Loading branch information
liqwang committed Jan 12, 2024
1 parent a89a3e4 commit 3798d92
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions phase4/test/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
subprocess.run(f'../bin/splc {id}.ir', shell=True)
for test in tests.read().split('\n\n'):
input, expect_out = test.split('\n----------\n')
input=input.replace(' ','\\n')
if '\\n' in input:
input=input+'\\n'
input=input.replace(' ','\n')
actual_out = (subprocess.run(f'echo "{input}" | spim -file {id}.s', shell=True, capture_output=True, text=True).stdout
.replace(spim_header, '') # remove SPIM's header
.replace(input_prompt,'') # remove input prompt
Expand Down

0 comments on commit 3798d92

Please sign in to comment.