Skip to content

test: pin PowerShell quoting of dotted and special -D arguments - #2815

Open
maxandersen-agent wants to merge 1 commit into
jbangdev:mainfrom
maxandersen-agent:1849-powershell-dash-d-tests
Open

maxandersen-agent wants to merge 1 commit into
jbangdev:mainfrom
maxandersen-agent:1849-powershell-dash-d-tests

Conversation

@maxandersen-agent

Copy link
Copy Markdown
Collaborator

pins the existing protection for dotted -D arguments on PowerShell (the #1849 trigger, -Dgroovy.grape.enable=false) with direct escaper tests. the escaper already quotes these; before this PR only javafx.preview covered it.

red check: treating '.' as safe makes the new dotted-name test fail, and the existing testPowershellEscapesUnsafeChars fails too.

Not fixed here: a colon in a -D name (-Dfoo:bar=baz) is dropped by PowerShell even when quoted, verified on Windows PowerShell 5.1. That needs a decision (warn or document), not an escaper change, so it's left out of this PR.

Relates to #1849

PowerShell 5.1 splits an unquoted -Dfoo.bar=baz at the dot and passes
the remainder on as a class name, so 'java -Dgroovy.grape.enable=false'
fails with ClassNotFoundException. The escaper already quotes such
arguments, but no test pinned that for PowerShell (the groovy option is
only checked at collection time, javafx.preview is the only dotted -D
escaping test).

Adds regression tests for dotted names and values with spaces/quotes.
Red-checked: treating '.' as a safe character fails them.

Relates to jbangdev#1849

Co-authored-by: maxandersen-agent <362451386+maxandersen-agent@users.noreply.github.com>
@maxandersen
maxandersen marked this pull request as ready for review December 4, 2026 17:27
@maxandersen
maxandersen requested a review from quintesse December 4, 2026 17:28
@maxandersen

Copy link
Copy Markdown
Collaborator

this is just to safeguard we dont by accident break quoting of .'s for pwsh/windows

@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Added tests for PowerShell argument quoting. The tests cover dotted -D property names, values with spaces, and doubled apostrophes in values.

Merge Risk: Minimal · up to 38ad3

This change only adds tests that pin existing PowerShell argument quoting for dotted -D names and for values with spaces or apostrophes. It does not change runtime behavior, so merge risk is minimal.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

📦 PR Build Available

Install this PR build:

curl -sL https://github.com/jbangdev/jbang-pr-builds/releases/download/pr-2815/jbang.tar | tar xf - && ./jbang/bin/jbang version

Release
| Built from 38ad3ed

This branch has not been deployed

No deployments
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