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

Separate parsing utils into new test-case-utils crate #114

Merged
merged 2 commits into from
Feb 10, 2023

Conversation

evforde
Copy link
Contributor

@evforde evforde commented Feb 6, 2023

Addresses #113

Since proc macro crates cannot publicly expose anything other than procedural macros, all utils for parsing #[test_case(...)] attributes aren't able to be made public.

This now allows other devs to use some of the parsing utils currently used by the test_case attribute

@@ -23,7 +23,7 @@ doctest = false
path = "src/lib.rs"

[dependencies]
test-case-macros = { version = "2.2.1", path = "crates/test-case-macros", default-features = false }
test-case-macros = { version = "2.2.2", path = "crates/test-case-macros", default-features = false }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seemed this bump was just missing, but lmk if I am missing something

Copy link
Collaborator

Choose a reason for hiding this comment

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

That's odd, coz on crates.io we definitely have correct one released

@@ -10,7 +10,6 @@ readme = "../../README.md"
license = "MIT"
repository = "https://github.com/frondeus/test-case"
documentation = "https://docs.rs/test-case"
exclude = ["tests/snapshots/**/*"]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this was from copy-pasting the root Cargo.toml, but again lmk if missing something :)

Copy link
Contributor Author

@evforde evforde left a comment

Choose a reason for hiding this comment

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

I also see a use case for just exporting TestCase from the root lib.rs, perhaps behind a feature. Right now, using the TestCase util externally requires other devs to import the test-case-utils macro explicitly. Lmk what you prefer

version = "2.2.2"
edition = "2018"
authors = ["Marcin Sas-Szymanski <[email protected]>", "Wojciech Polak <[email protected]>", "Łukasz Biel <[email protected]>"]
description = "Provides utils for parsing #[test_case(...)] procedural macro attribute for generating parametrized test cases easily"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Feel free to tweak this - this Cargo.toml is mostly copy-paste from the old test-case-macros/Cargo.toml with a different description and dropping the proc-macro = true

@evforde evforde marked this pull request as ready for review February 6, 2023 21:07
@evforde
Copy link
Contributor Author

evforde commented Feb 6, 2023

Took a small stab at this, let me know what you think @luke-biel 🙂

@luke-biel
Copy link
Collaborator

luke-biel commented Feb 9, 2023

It looks fine. If you run rustfmt on it and all tests pass we can merge it @evforde :)

I'm gonna look into that 1.49 tests fail. If they keep on acting up, we'll just drop them. As much as I hate it, in order to keep maintaining this crate we'll probably have to make looser MSRV and validation policy.

@luke-biel
Copy link
Collaborator

I had to push changes which you partialy did in order to preserve CI green-ness, hope it's not too problematic to rebase your PR with new master.

Rename test-case-utils to test-case-core

Fix clippy

Actually fix clippy
@evforde
Copy link
Contributor Author

evforde commented Feb 9, 2023

Nice! Thanks for doing the surgery out of my pay grade @luke-biel, appreciate all the support :) Rebased no problem - can you approve the workflows to kick of CI once more before I merge?

@evforde
Copy link
Contributor Author

evforde commented Feb 10, 2023

Ok, this time I feel good 😆 ran CI locally. One more workflow kick off? @luke-biel

@luke-biel luke-biel merged commit 70a962f into frondeus:master Feb 10, 2023
@luke-biel
Copy link
Collaborator

Merged. I'm gonna release it today evening @evforde

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.

None yet

3 participants