Skip to content

Call with in more tests#2119

Merged
Goooler merged 1 commit into
mainfrom
g/20260723/call-with
Jul 23, 2026
Merged

Call with in more tests#2119
Goooler merged 1 commit into
mainfrom
g/20260723/call-with

Conversation

@Goooler

@Goooler Goooler commented Jul 23, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors several Kotlin test cases to use with(...) blocks (and expression-bodied test functions) to reduce repeated transformer. qualifiers and improve consistency across transformer-related tests.

Changes:

  • Converted multiple @Test/@ParameterizedTest methods to expression bodies returning with(transformer) { ... }.
  • Updated test bodies to call transformer members directly within the with receiver.
  • Applied the same pattern to a few tests that instantiate transformers inline (e.g., with(ServiceFileTransformer()) { ... }).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/XmlAppendingTransformerTest.kt Refactor to with(transformer) for concise resource setup and assertions.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ServiceFileTransformerTest.kt Refactor multiple tests/parameterized tests to use with(...) receivers for transformer calls.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/PropertiesFileTransformerTest.kt Refactor parameterized tests and assertions to use with(transformer) and receiver-qualified properties.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ManifestAppenderTransformerTest.kt Refactor to with(transformer) for append/transform assertions and the “noTransformation” case.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/Log4j2PluginsCacheFileTransformerTest.kt Refactor tests to use with(transformer) while keeping transformation and jar inspection logic intact.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ComponentsXmlResourceTransformerTest.kt Refactor to with(transformer) for transform calls and XML comparison.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/AppendingTransformerTest.kt Refactor to with(transformer) for resource setup and can-transform assertions.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ApacheNoticeResourceTransformerTest.kt Refactor to with(transformer) for include/exclude and output validation.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/transformers/ApacheLicenseResourceTransformerTest.kt Refactor to with(transformer) for include/exclude and can-transform assertions.
src/test/kotlin/com/github/jengelman/gradle/plugins/shadow/internal/MinimizeSpecsTest.kt Refactor to with(...) for concise spec creation and assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Goooler
Goooler merged commit 3be5c8d into main Jul 23, 2026
5 checks passed
@Goooler
Goooler deleted the g/20260723/call-with branch July 23, 2026 03:51
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