Skip to content
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

Allow boolean parsing of strings containing 0 and 1 #29997

Merged
merged 1 commit into from Nov 28, 2018

Conversation

5 participants
@kim366
Copy link
Contributor

commented Nov 11, 2018

Fixes #29980

The following tests pass:

@test parse(Bool, "1") == true
@test parse(Bool, "01") == true
@test parse(Bool, "0") == false
@test parse(Bool, "000000000000000000000000000000000000000000000000001") == true
@test parse(Bool, "000000000000000000000000000000000000000000000000000") == false
@test_throws ArgumentError parse(Bool, "1000000000000000000000000000000000000000000000000000")
@test_throws ArgumentError parse(Bool, "2")
@test_throws ArgumentError parse(Bool, "02")
@kim366

This comment has been minimized.

Copy link
Contributor Author

commented Nov 12, 2018

@ararslan Tests added

Show resolved Hide resolved test/parse.jl Outdated

@ararslan ararslan removed the needs tests label Nov 12, 2018

@kim366 kim366 force-pushed the kim366:master branch from 690198b to e08067c Nov 13, 2018

@StefanKarpinski

This comment has been minimized.

Copy link
Member

commented Nov 13, 2018

This seems to break the parsing of JULIA_CPU_THREADS quite badly.

@StefanKarpinski
Copy link
Member

left a comment

Please investigate the JULIA_CPU_THREADS parsing failure.

@kim366

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2018

@StefanKarpinski hm, can you point me to some specific file or give me an example?

@ararslan

This comment has been minimized.

Copy link
Member

commented Nov 13, 2018

Take a look at the CI job logs to see the failures.

Though it appears other PRs are experiencing this as well, so I'm inclined to think something else has introduced this problem on master.

@StefanKarpinski

This comment has been minimized.

@kim366

This comment has been minimized.

Copy link
Contributor Author

commented Nov 13, 2018

Yeah, I'm getting very similar CI output to the newest master commit and all parse tests are passing

@iblis17

This comment has been minimized.

Copy link
Member

commented Nov 14, 2018

FreeBSD CI passed now. Sorry for that parsing failure.

@StefanKarpinski

This comment has been minimized.

Copy link
Member

commented Nov 14, 2018

Failures are #29923.

Requested changes were not related to this PR.

@JeffBezanson JeffBezanson added this to the 1.1 milestone Nov 28, 2018

@JeffBezanson

This comment has been minimized.

Copy link
Member

commented Nov 28, 2018

Thanks, @kim366 ! I'll add news for this.

@JeffBezanson JeffBezanson merged commit d4c6d16 into JuliaLang:master Nov 28, 2018

1 of 3 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
julia freebsd ci Build done
Details
@kim366

This comment has been minimized.

Copy link
Contributor Author

commented Nov 28, 2018

My first merged pull request <3 one life goal reached

@ararslan

This comment has been minimized.

Copy link
Member

commented Nov 28, 2018

Good work here and thanks for the contribution! I hope you'll continue to contribute to Julia. 🙂

fredrikekre added a commit that referenced this pull request Dec 5, 2018

Addition of NEWS and compat admonitions for important
changes between Julia 1.0 and 1.1, including:

- Custom .css-style for compat admonitions.

- Information about compat annotations to CONTRIBUTING.md.

- NEWS.md entry for PRs #30090, #30035, #30022, #29978,
  #29969, #29858, #29845, #29754, #29638, #29636, #29615,
  #29600, #29506, #29469, #29316, #29259, #29178, #29153,
  #29033, #28902, #28761, #28745, #28708, #28696, #29997,
  #28790, #29092, #29108, #29782

- Compat annotation for PRs #30090, #30013, #29978,
  #29890, #29858, #29827, #29754, #29679, #29636, #29623,
  #29600, #29440, #29316, #29259, #29178, #29157, #29153,
  #29033, #28902, #28878, #28761, #28708, #28156, #29733,
  #29670, #29997, #28790, #29092, #29108, #29782, #25278

- Documentation for broadcasting CartesianIndices (#30230).
- Documentation for Base.julia_cmd().
- Documentation for colon constructor of CartesianIndices (#29440).
- Documentation for ^(::Matrix, ::Number) and ^(::Number, ::Matrix).

- Run NEWS-update.jl.

Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>

fredrikekre added a commit that referenced this pull request Dec 5, 2018

Addition of NEWS and compat admonitions for important
changes between Julia 1.0 and 1.1, including:

- Custom .css-style for compat admonitions.

- Information about compat annotations to CONTRIBUTING.md.

- NEWS.md entry for PRs #30090, #30035, #30022, #29978,
  #29969, #29858, #29845, #29754, #29638, #29636, #29615,
  #29600, #29506, #29469, #29316, #29259, #29178, #29153,
  #29033, #28902, #28761, #28745, #28708, #28696, #29997,
  #28790, #29092, #29108, #29782

- Compat annotation for PRs #30090, #30013, #29978,
  #29890, #29858, #29827, #29754, #29679, #29636, #29623,
  #29600, #29440, #29316, #29259, #29178, #29157, #29153,
  #29033, #28902, #28878, #28761, #28708, #28156, #29733,
  #29670, #29997, #28790, #29092, #29108, #29782, #25278

- Documentation for broadcasting CartesianIndices (#30230).
- Documentation for Base.julia_cmd().
- Documentation for colon constructor of CartesianIndices (#29440).
- Documentation for ^(::Matrix, ::Number) and ^(::Number, ::Matrix).

- Run NEWS-update.jl.

Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>

fredrikekre added a commit that referenced this pull request Dec 5, 2018

Compat admonitions and NEWS for Julia 1.1 (#30230)
Addition of NEWS and compat admonitions for important changes between Julia 1.0 and 1.1, including:

- Custom .css-style for compat admonitions.

- Information about compat annotations to CONTRIBUTING.md.

- NEWS.md entry for PRs #30090, #30035, #30022, #29978,
  #29969, #29858, #29845, #29754, #29638, #29636, #29615,
  #29600, #29506, #29469, #29316, #29259, #29178, #29153,
  #29033, #28902, #28761, #28745, #28708, #28696, #29997,
  #28790, #29092, #29108, #29782

- Compat annotation for PRs #30090, #30013, #29978,
  #29890, #29858, #29827, #29754, #29679, #29636, #29623,
  #29600, #29440, #29316, #29259, #29178, #29157, #29153,
  #29033, #28902, #28878, #28761, #28708, #28156, #29733,
  #29670, #29997, #28790, #29092, #29108, #29782, #25278

- Documentation for broadcasting CartesianIndices (#30230).
- Documentation for Base.julia_cmd().
- Documentation for colon constructor of CartesianIndices (#29440).
- Documentation for ^(::Matrix, ::Number) and ^(::Number, ::Matrix).

- Run NEWS-update.jl.


Co-authored-by: Morten Piibeleht <morten.piibeleht@gmail.com>
Co-authored-by: Fredrik Ekre <ekrefredrik@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.