Repository navigation
[TEST] PathUtils: round-trip CJK / spaces / >260-char paths through to_path (#9460) - #9528
Conversation
…o_path (OpenMS#9460) PathUtils_test only asserted ASCII identity plus one non-empty UTF-8 'ä' case. Since the Qt removal all file I/O flows through OpenMS::to_path(const std::string&), so the non-ASCII path handling needs an end-to-end guard. Adds round-trip cases asserting that a valid UTF-8 string survives to_path() -> path::u8string() byte-for-byte (u8string() is UTF-8 on every platform, unlike string() which is lossy on the Windows ANSI code page): - CJK (Japanese), embedded spaces/parentheses, a >300-char name (well past the historical Windows MAX_PATH of 260; path construction must not truncate/throw), and a mixed CJK + Latin-1-diacritic name. The existing 'ä' case is upgraded from a non-empty check to a full round-trip. Verified: builds clean and the test runs PASSED. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
@timosachsenberg The following names might be missing from the
Please consider applying the following patch: --- AUTHORS 2026-06-15 15:20:29.838765240 +0000
+++ AUTHORS.new 2026-06-15 15:20:35.035769772 +0000
@@ -23,8 +23,8 @@
- Chirag Dave
- Chris Bauer
- Chris Bielow
- - Christie Mathews
- Christian Ehrlich
+ - Christie Mathews
- Clemens Groepl
- Cornelia Friedle
- Daniel Jameson |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA local ChangesUTF-8 Round-Trip Test Coverage
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
What
Extends
PathUtils_testwith byte-exact round-trip cases forOpenMS::to_path(const std::string&):日本語.mzML)my data file (run 1).mzML)MAX_PATHof 260; constructing the path object must not truncate or throw, since that limit applies to filesystem operations, not to the path object)测试 äö.featureXML)The existing
äcase is upgraded from a non-empty check to a full round-trip.Why
Closes the §1 (Qt removal / infrastructure)
[AUTO]task in the OpenMS 3.6.0 pre-release testing plan (#9460):Before this,
PathUtils_testasserted only ASCII identity plus a single non-emptyäcase. Since the Qt removal, all file I/O flows throughto_path(), so the non-ASCII handling deserves an end-to-end guard.The round-trip is asserted via
path::u8string(), which is UTF-8 on every platform — unlikestring(), which is lossy on the Windows ANSI code page. So these cases are meaningful cross-platform, not just on Linux. (The Windows-only ANSI-codepage / UNC sub-item from the issue is a separate task and not in scope here.)Test plan
Tests only — no production code changed. Verified locally three ways:
<filesystem>snippet first;-fsyntax-onlyclean, then full target build green;Part of #9460. Follows #9524, #9525, #9526.
🤖 Generated with Claude Code
Summary by CodeRabbit