Skip to content

test(normalizer): fix the escaped-path base case failing on windows - #309

Merged
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:fix/normalize-base-escaped-path-on-windows
Aug 25, 2026
Merged

test(normalizer): fix the escaped-path base case failing on windows#309
fredbi merged 1 commit into
go-openapi:masterfrom
fredbi:fix/normalize-base-escaped-path-on-windows

Conversation

@fredbi

@fredbi fredbi commented Aug 25, 2026

Copy link
Copy Markdown
Member

TestNormalizer_CanonicalBase/escaped_path_rendering expected normalizeBase("%2F") to be "file:///". A base carrying no scheme is anchored to the working directory, so on windows it comes out as "file:///d:", or whichever drive the tests run from.

The case moves out of the table into TestNormalizer_EscapedPathRendering, which compares normalizeBase("%2F") against normalizeBase("/") rather than a literal: both spell the root and both are anchored the same way, on either platform. It also asserts what the defect actually was, that the result is neither "file://%2F" nor something parseURL rejects.

Change type

Please select: 🆕 New feature or enhancement|🔧 Bug fix'|📃 Documentation update

Short description

Fixes

Full description

Checklist

  • I have signed all my commits with my name and email (see DCO. This does not require a PGP-signed commit
  • I have rebased and squashed my work, so only one commit remains
  • I have added tests to cover my changes.
  • I have properly enriched go doc comments in code.
  • I have properly documented any breaking change.

TestNormalizer_CanonicalBase/escaped_path_rendering expected normalizeBase("%2F")
to be "file:///". A base carrying no scheme is anchored to the working directory,
so on windows it comes out as "file:///d:", or whichever drive the tests run from.

The case moves out of the table into TestNormalizer_EscapedPathRendering, which
compares normalizeBase("%2F") against normalizeBase("/") rather than a literal:
both spell the root and both are anchored the same way, on either platform. It
also asserts what the defect actually was, that the result is neither
"file://%2F" nor something parseURL rejects.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Frederic BIDON <fredbi@yahoo.com>
@codecov

codecov Bot commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@34af4e1). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #309   +/-   ##
=========================================
  Coverage          ?   93.03%           
=========================================
  Files             ?       30           
  Lines             ?     2512           
  Branches          ?        0           
=========================================
  Hits              ?     2337           
  Misses            ?      175           
  Partials          ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@fredbi
fredbi merged commit 69a6c4c into go-openapi:master Aug 25, 2026
24 checks passed
@fredbi
fredbi deleted the fix/normalize-base-escaped-path-on-windows branch August 25, 2026 14:19
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.

1 participant