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

fix: underflow during datetime->nanos conversion #1294

Merged
merged 1 commit into from
Sep 15, 2023

Conversation

crepererum
Copy link
Contributor

Fixes #1289.

@codecov
Copy link

codecov bot commented Sep 15, 2023

Codecov Report

Merging #1294 (9b99830) into 0.4.x (3c4846a) will increase coverage by 0.02%.
Report is 3 commits behind head on 0.4.x.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##            0.4.x    #1294      +/-   ##
==========================================
+ Coverage   91.33%   91.35%   +0.02%     
==========================================
  Files          38       38              
  Lines       16971    17034      +63     
==========================================
+ Hits        15501    15562      +61     
- Misses       1470     1472       +2     
Files Changed Coverage Δ
src/datetime/tests.rs 96.50% <100.00%> (+0.07%) ⬆️
src/naive/datetime/mod.rs 97.39% <100.00%> (+0.04%) ⬆️

... and 2 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough test case!

i64::MAX - 1,
i64::MAX,
] {
println!("nanos: {nanos}");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove this println!? Or can you change it so that the test compiles on Rust 1.57 (our MSRV)?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just needs println!("nanos: {}", nanos).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adjusted the println to be compatible w/ Rust 1.57. I think keeping it helps debugging a failing tests due to the many cases1.

Footnotes

  1. I wish there would be a slightly nicer story for parametrized tests in "standard Rust" though.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Hopefully there will be in the not-too-distant future.)

@pitdicker pitdicker merged commit 2afdde8 into chronotope:0.4.x Sep 15, 2023
37 checks passed
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.

3 participants