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

pr: use chrono instead of time in tests #5972

Closed
cakebaker opened this issue Feb 13, 2024 · 2 comments · Fixed by #5973
Closed

pr: use chrono instead of time in tests #5972

cakebaker opened this issue Feb 13, 2024 · 2 comments · Fixed by #5973
Labels

Comments

@cakebaker
Copy link
Contributor

When running cargo test --features "pr" --no-default-features the following errors are shown:

error[E0432]: unresolved import `time::macros`
 --> tests/by-util/test_pr.rs:9:11
  |
9 | use time::macros::format_description;
  |           ^^^^^^ could not find `macros` in `time`

error: cannot determine resolution for the macro `format_description`
  --> tests/by-util/test_pr.rs:14:5
   |
14 |     format_description!("[month repr:short] [day] [hour]:[minute] [year]");
   |     ^^^^^^^^^^^^^^^^^^
   |
   = note: import resolution is stuck, try simplifying macro imports

error[E0433]: failed to resolve: could not find `format_description` in `time`
  --> tests/by-util/test_pr.rs:13:33
   |
13 | const DATE_TIME_FORMAT: &[time::format_description::FormatItem] =
   |                                 ^^^^^^^^^^^^^^^^^^ could not find `format_description` in `time`

error[E0599]: no method named `format` found for struct `OffsetDateTime` in the current scope
  --> tests/by-util/test_pr.rs:24:31
   |
24 |                     date_time.format(&DATE_TIME_FORMAT).unwrap()
   |                               ^^^^^^ method not found in `OffsetDateTime`

error[E0599]: no method named `format` found for struct `OffsetDateTime` in the current scope
  --> tests/by-util/test_pr.rs:37:26
   |
37 |         vec.push(current.format(&DATE_TIME_FORMAT).unwrap());
   |                          ^^^^^^ method not found in `OffsetDateTime`

The reason is #4942: it replaced time with chrono and forgot to adapt the tests.

I noticed this issue as it showed up as a side effect in #5934

@biplab5464
Copy link
Contributor

can i try to do it

@tertsdiepraam
Copy link
Member

Go ahead!

biplab5464 pushed a commit to biplab5464/coreutils that referenced this issue Feb 14, 2024
@cakebaker cakebaker linked a pull request Feb 15, 2024 that will close this issue
cakebaker added a commit that referenced this issue Feb 15, 2024
 pr: use chrono instead of time in tests #5972
ysthakur pushed a commit to ysthakur/coreutils that referenced this issue Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants