Skip to content

Conversation

@Turbo87
Copy link
Collaborator

@Turbo87 Turbo87 commented Dec 27, 2024

This PR changes how the TestClient struct from axum is shared with axum-extra and also makes it available to axum-core.

This change avoids the somewhat arcane include!(concat!(...)) construct in the axum-extra crate, which some IDEs (JetBrains) don't like particularly much. The alternative proposed by this PR is a __private feature, similar to the one in axum-macros, that enables the public export of the TestClient struct. The axum dev-dependencies in the other two crates then enable that feature, so that it can be used in their test suites.

This enables us to move the request_parts tests into axum-core, next to the implementation that they are testing.

This avoids the somewhat arcane `include!(concat!(...))` construct in the `axum-extra` crate, which some IDEs (JetBrains) don't like particularly much...
This is where the extractor is implemented, so it would make sense to colocate the tests there too.
@jplatte
Copy link
Member

jplatte commented Dec 27, 2024

I like the idea! Will review later.

@Turbo87 Turbo87 merged commit 28d8d9b into tokio-rs:main Dec 27, 2024
18 checks passed
@Turbo87 Turbo87 deleted the test-client branch December 27, 2024 22:03
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