-
-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unneeded visit_expr()
and fix stdin
#3694
Remove unneeded visit_expr()
and fix stdin
#3694
Conversation
This was discovered in lcompilers/lpython#2601 (comment). |
@certik how should we add a test for this to ensure it does not break in future? |
I am merging this as the changes seem trivial. I think we can add the test in a separate PR. |
Thanks! I saw that it failed too yesterday. |
Do you know/suggest any approach to test this? |
Can the input in be tested using a bash script that feeds the input on stdin? |
We can simply redirect the input stream to a file using % cat expr2.f90
program expr2
implicit none
character(len = 10) :: name
print *, "Name:"
read(*, *) name
print *, "Name: ", name
if (name /= "Joe") error stop
end program
% cat tmp.txt
Joe
% cat test.sh
#!/usr/bin/env bash
lfortran expr2.f90 -o expr2
./expr2 < tmp.txt
% ./test.sh
Name:
Name: Joe
% echo $?
0 |
Let's add a cmake test for this, a new category/label, and in cmake pass in the input to stdin, and ensure it fails if there is a bug like it was before this PR. |
visit_expr()
and fix stdin
and get back stdin read working.