Skip to content

Tests: Add WriteOptions::parse_options regression test - #713

Merged
Serial-ATA merged 1 commit into
Serial-ATA:mainfrom
mitchtaylormx:fix-write-options-parse
Sep 9, 2026
Merged

Serial-ATA merged 1 commit into
Serial-ATA:mainfrom
mitchtaylormx:fix-write-options-parse

Conversation

@mitchtaylormx

@mitchtaylormx mitchtaylormx commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a regression test for issue #711 / PR #712.

The test exercises writing a tag to an MP3 containing more than the default 1024 bytes of leading junk, while supplying ParseOptions with max_junk_bytes(3000) through WriteOptions.

This test fails with the pre-#712 implementation because the internal initial probe ignored WriteOptions.parse_options, and passes with the fix from PR #712.

Testing

  • cargo test -p lofty --test files mpeg::test_tag_save_with_parse_options

  • 1 passed

  • cargo test -p lofty --test files

  • 123 passed

  • 0 failed

  • 0 ignored

@Serial-ATA Serial-ATA left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

tests/taglib isn't the right place to put this, that dir only mirrors the tests from TagLib. tests/files/mpeg.rs would be better

@mitchtaylormx
mitchtaylormx force-pushed the fix-write-options-parse branch from 6e2744e to bc032c2 Compare September 8, 2026 01:30
@mitchtaylormx

Copy link
Copy Markdown
Contributor Author

Got it moved. Sorry, thought about the other files tests before I put it in the wrong place... It just seemed so similar to the taglib one I had placed it after not realizing that those are a standard test lib (or something like that...) Hope this helps. Regards and thanks for the quick updates. I'm looking forward to 0.25.2 to start integrating it, but I am also trying to run some speed tests after making a move from lofty 0.22.x...

@Serial-ATA

Copy link
Copy Markdown
Owner

Thanks, LGTM after the formatting is fixed

I am also trying to run some speed tests after making a move from lofty 0.22.x...

Have you noticed worse performance in newer versions?

@mitchtaylormx
mitchtaylormx force-pushed the fix-write-options-parse branch from bc032c2 to e6bb606 Compare September 8, 2026 18:18
@mitchtaylormx

Copy link
Copy Markdown
Contributor Author

My 'sed' command to move it wasn't perfect... I should have looked at it in the file... All better now.

The changes I made to move from 0.22.2 to 0.25.1 by replacing all the ::Unknown usage with file specific functions with the correct (I think) methods to, in particular, add a new non-standard tag seem a fair amount slower. It might be that I am reading multiple times (or some bad coding... ) when I should not be, or something else. Reads seem fast, the slowest seems to be writing to a flac with a new tag inserted. I have some timing checks in the code I am still testing to see if I can find the slowdown...

@Serial-ATA Serial-ATA added this to the 0.25.2 milestone Sep 9, 2026
@Serial-ATA Serial-ATA changed the title Add regression test for WriteOptions parse options Tests: Add WriteOptions::parse_options regression test Sep 9, 2026
@Serial-ATA
Serial-ATA merged commit d7c7daf into Serial-ATA:main Sep 9, 2026
5 checks passed
@mitchtaylormx
mitchtaylormx deleted the fix-write-options-parse branch September 9, 2026 07:05
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