-
Notifications
You must be signed in to change notification settings - Fork 48
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
Distinguish reading empty binaries from timeout #33
Comments
At first I thought it was a little weird to write an empty string, but I suppose that if you have a framer that allows it, then it would be an ok thing to do. Given that, I agree that Also, that's awesome that propcheck caught this case! |
@pallix, do you have the propcheck test for this? I would love to see it. |
Really there is nothing special to the test. We have a wrapper around
Basically the test would fail because Setup is done with:
I hope this help. |
Nerves.UART.read
returns{:ok, ""}
upon timeout. When testing some code I noticed it is possible to useNervers.UART.write
with an empty string (""
) and it is possible to read it:{:ok, ""}
will also be returned. So it is not possible to distinguish between empty binaries being written and timeout.I do not need to write empty binaries on the serial but noticed this while using propcheck and tty0tty.
Would it make sense to distinguish timeout and empty binaries? (by returning
:timeout
for example)The text was updated successfully, but these errors were encountered: