-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Support binary literal format for String
to Number
conversion
#3605
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
Comments
We actually provide support for decimal, hexadecimal, and octal numbers simply because that's what I had forgotten about binary literals, since I never use them personally, but...
So, although we could potentially introduce explicit support for binary literals in @sormuras, thoughts? |
String
to Number
conversion
https://bugs.openjdk.org/browse/JDK-7181749 "Integer.decode("0b1010101") fails" has:
Which in turn https://bugs.openjdk.org/browse/JDK-6863378 "Project Coin: Consider library support for underscores in numbers and binary literals" has:
So, supporting such conversions is an option for JUnit - if there's enough interest from users and we are willing to maintain it. |
Guys, thank you for the replies anyway. It was the first time when I decide to use I understand that JUnit relies on JDK API. So it won't be a problem if you just close this issue with won't be fixed status. |
Thanks for the detailed discussion above. I'd be happy to work on a PR that adds support for binary literals(e.g, Would the team be open to such a contribution, assuming it comes with tests and minimal maintenance overhead? Thanks again for your work on JUnit.! |
Let's hold off on this issue until #853 is resolved. |
Thanks for the clarification, @marcphilipp. Looking forward to contributing when the time is right. |
Hi @young0264, you could provide your feedback on #4219, once it's no longer a draft or after it's been merged. For a preview of its usage, see #4514 (comment). |
At the moment there is support for hexadecimal literals but not for binary:
The text was updated successfully, but these errors were encountered: