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

Add a test case to indicate shebang including invalid utf-8 char #29

Merged
merged 2 commits into from
Aug 5, 2020

Conversation

u5surf
Copy link
Contributor

@u5surf u5surf commented Jul 4, 2020

To fixes #28, cover the test for
https://codecov.io/gh/brettcannon/python-launcher/src/master/src/cli.rs#L148


  • UNDERSTOOD: Brett is using this project to teach himself Rust, so I will
    not feel offended if he chooses not to accept this PR in order for him to learn how to do
    something on his own. (PRs to do something more idiomatically are very much appreciated,
    though.)

@codecov
Copy link

codecov bot commented Jul 4, 2020

Codecov Report

Merging #29 into master will increase coverage by 0.32%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master       #29      +/-   ##
===========================================
+ Coverage   99.67%   100.00%   +0.32%     
===========================================
  Files           2         2              
  Lines         312       312              
===========================================
+ Hits          311       312       +1     
+ Misses          1         0       -1     
Impacted Files Coverage Δ
src/cli.rs 100.00% <100.00%> (+0.67%) ⬆️
src/lib.rs 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ffbdeac...ab35620. Read the comment docs.

@brettcannon
Copy link
Owner

@u5surf I just wanted to say thanks for the PR and that I am not purposefully ignoring it; just been too busy to work on this project lately. But I will eventually review it.

src/cli.rs Outdated Show resolved Hide resolved
@brettcannon brettcannon merged commit 2361a7f into brettcannon:master Aug 5, 2020
@brettcannon
Copy link
Owner

Thanks, @u5surf !

@zachgates
Copy link

Hey there.

I was in the process of reading through the source code (trying to assimilate some Rust literacy), and I happened upon a typo in /src/cli.rs. I considered opening a new issue, but ultimately decided that the de facto label, bug, was not an apt descriptor. So, I dug a bit deeper — looking for someone to git blame — and wound up here.


The aggregate changes contained in this PR were merged into main at 2361a7f from u5surf:issue-28.

    #[test_case(&[0x23, 0x21, 0xc0, 0xaf] => None ; "invalid UTF-8")]
    fn parse_python_sheban_include_invalid_bytes_tests(
        mut shebang: &[u8],
    ) -> Option<RequestedVersion> {
        parse_python_shebang(&mut shebang)
    }

The word-perfect function name is parse_python_shebang_include_invalid_bytes_tests — as sheban becomes shebang. Extrapolating from your commit history, I presume that a supplementary commit (amending this functionally insignificant typo) would be the normative solution.

I would be happy to make the small contribution myself; however, naturally, you can do whatever you like.


I would also like to extend my thanks to you for everything you have done here, across the board. Speaking as someone almost totally unfamiliar to Rust, I've gleaned a surprising amount of practical knowledge here — be it idiomatic or not, which I'm sure will increase with additional read-throughs. And, lastly: I'm glad there is finally this promising py port! I'm surprised we've gone this far down the road without one; it's only logical to have a cross-platform solution!

@brettcannon
Copy link
Owner

@zachgates if you want the contribution, feel free to open a PR, but I can also just make the fix in-place very quickly.

And glad you're getting something (hopefully good) out of the code base!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get to 100% test coverage
3 participants