Skip to content

Add test for --since #1859

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

Merged
merged 1 commit into from
Mar 16, 2025
Merged

Conversation

cruessler
Copy link
Contributor

I wanted to add the following test for AsTime, but it fails with the following message:

error: invalid value ''2 weeks ago'' for '--since <ARG>': Date string can not be parsed

Am I using AsTime incorrectly or is there an issue with the way the test is written?

I initially created the test to be part of #1858.

@Byron
Copy link
Member

Byron commented Feb 22, 2025

That's interesting!

I know there are tests for 2.weeks.ago, but I thought space should definitely work as well.

@cruessler
Copy link
Contributor Author

My first hunch was that it had to do with ' as the error message contained 2 '' in a row in front and after the string, but I didn’t investigate further.

@cruessler cruessler force-pushed the add-failing-test-for-as-time branch from 9d3a0bd to 330711d Compare March 13, 2025 17:13
@cruessler
Copy link
Contributor Author

cruessler commented Mar 13, 2025

There was an issue with the way the test was written (now it passes). Cmd::parse_from does not parse quoted strings, that is handled by the shell. See clap-rs/clap#1315.

Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Yes, that makes sense.
Thanks for figuring out the fix so we can have these tests.

@Byron Byron merged commit 36a846f into GitoxideLabs:main Mar 16, 2025
21 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.

2 participants