🧪 Add tests for MetadataEngine SanitizeForPath edge cases#3
Conversation
Adds `MetadataEngineTests.cs` to explicitly test `GetSubFolder` handling of artist names containing invalid path characters (like '?', '*', ':') and empty strings. Mock MP3 files are generated via TagLib with embedded valid frames to ensure comprehensive and side-effect free metadata testing. Included modifications to allow cross-platform headless testing. Co-authored-by: gonzoga <6003443+gonzoga@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Adds `MetadataEngineTests.cs` to explicitly test `GetSubFolder` handling of artist names containing invalid path characters (like '?', '*', ':') and empty strings. Mock MP3 files are generated via TagLib with embedded valid frames to ensure comprehensive and side-effect free metadata testing. Included modifications to allow cross-platform headless testing. Resolved upstream conflicts to include master file assertions. Co-authored-by: gonzoga <6003443+gonzoga@users.noreply.github.com>
Adds `MetadataEngineTests.cs` explicitly testing `GetSubFolder` handling of artist names containing invalid path characters (like '?', '*', ':') and empty strings. Mock MP3 files are generated via TagLib with embedded valid frames to ensure comprehensive and side-effect free metadata testing. Included modifications to allow cross-platform headless testing. Resolved upstream conflicts to include master file assertions. Co-authored-by: gonzoga <6003443+gonzoga@users.noreply.github.com>
🎯 What: The testing gap addressed
This PR addresses the missing unit tests for the private
SanitizeForPathmethod inMetadataEngine.csby indirectly testing it via theGetSubFoldermethod using temporary mock MP3 files generated with TagLib.📊 Coverage: What scenarios are now tested
The new tests cover:
AC/DC,The:Who,Artist?Name).*:*,///), correctly falling back to "Unknown" or "Unknown Artist".✨ Result: The improvement in test coverage
The codebase now safely and robustly verifies how the organizer handles erratic metadata when classifying audio, preventing crashes or filesystem errors upon deployment. To achieve this cleanly in testing, a minimal valid MP3 frame was constructed in memory to ensure
TagLibdoes not throw aCorruptFileException.PR created automatically by Jules for task 13391177433328017201 started by @gonzoga