Skip to content

Conversation

@uimataso
Copy link

Problem

While exploring how to implement my own extension, I noticed that adding a new argument to tests::test_markdown_html causes 1000+ lines of changes, because every test cases requires an additional false argument. For example, in PR #991, more than half of the diff is just adding an extra false to test_markdown_html.

So I think it is a good idea to refactor the test generation to reduce the diff noise.

Solution

Introduce a configuration struct (with #[derive(Default)]) to hold all test options. This allows new options to be added without modifying every single test invocation, only the tests that actually depend on the new option need to be updated.

@ollpu
Copy link
Collaborator

ollpu commented Nov 14, 2025

I have definitely thought the same. This should make the spec test system easier to scale.

I'm wondering if this needs a separate type, or if we could get away with using Options directly, maybe with a function that gives the "test defaults"?

There's actually already a new class of tests merged into branch-0.14, which would be the next release. Could you change your merge target to that and add the new class introduced in #1043?

(We have been doing branching like this, where master is the stable version and breaking changes are first merged into a separate branch. Maybe we should discuss changing that to the more typical approach where master/main/dev is the main integration branch with a static name. Non-breaking changes can then be backported on top of the stable version if deemed necessary.)

@ollpu
Copy link
Collaborator

ollpu commented Nov 14, 2025

I started a thread about branching in the old Zulip:

#pulldown-cmark > Branching strategy

cc @Martin1887 @notriddle

@uimataso
Copy link
Author

There's actually already a new class of tests merged into branch-0.14, which would be the next release. Could you change your merge target to that and add the new class introduced in #1043?

sure! I'll do that.

I'm wondering if this needs a separate type, or if we could get away with using Options directly, maybe with a function that gives the "test defaults"?

Yeah, I could use Options directly in the generated test, I think this is better too.

@uimataso uimataso changed the base branch from master to branch-0.14 November 15, 2025 06:42
@uimataso
Copy link
Author

@ollpu I have updated the generated tests to use Options directly, and also included the new test class container_extensions.

@ollpu ollpu changed the base branch from branch-0.14 to master November 15, 2025 15:06
@ollpu
Copy link
Collaborator

ollpu commented Nov 15, 2025

Thanks, I will take a closer look soon.

We clarified our branching strategy. master/main will be the integration point including breaking changes, so I changed the merge target back.

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