Skip to content

Conversation

@QuietMisdreavus
Copy link
Contributor

@QuietMisdreavus QuietMisdreavus commented Oct 30, 2025

Bug/issue #, if applicable: rdar://163704908

Summary

When swiftlang/swift-markdown#237 was merged, a test in Swift-DocC started failing due to changes in the Swift-Markdown formatter. This PR updates the test assertion to trim whitespace and newlines, since the failure we saw was that an extra newline character was being inserted at the beginnings of lines.

Dependencies

None (The PR in Swift-Markdown was reverted, but the change here passes before and after the change is present.)

Testing

This is a test-only change. Ensure that all tests continue to pass, even after running swift package update swift-markdown.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • [ n/a ] Added tests
  • Ran the ./bin/test script and it succeeded
  • [ n/a ] Updated documentation if necessary

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

XCTAssertEqual(symbol.abstract?.format(), "This is an abstract.")
XCTAssertEqual(symbol.discussion?.content.map { $0.format() }, [
#"\abstract This is description with abstract."#,
#"\discussion This is a discussion linking to ``doc://unit-test/documentation/ModuleName/AnotherClass`` and ``doc://unit-test/documentation/ModuleName/AnotherClass/prop``."#,
Copy link
Contributor

Choose a reason for hiding this comment

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

This assertions verify that 3 of the 4 symbol links in this text content resolves as expectedly.

Could we trim whitespace and newlines instead so that the test expectation is more flexible without losing the verification that the links are resolved in the markup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This sounds reasonable to me. I didn't know what the assertion was there for, but this makes sense. I've updated the commit to do this instead.

@QuietMisdreavus QuietMisdreavus force-pushed the remove-format-assertions branch from 125d6be to 331633b Compare October 31, 2025 23:25
@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus QuietMisdreavus changed the title remove test assertions on swift-markdown's formatter trim whitespace in the DoxygenTests when calling the MarkupFormatter Oct 31, 2025
Copy link
Contributor

@d-ronnqvist d-ronnqvist left a comment

Choose a reason for hiding this comment

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

LGTM

@QuietMisdreavus QuietMisdreavus merged commit 15dde00 into swiftlang:main Nov 3, 2025
2 checks passed
@QuietMisdreavus QuietMisdreavus deleted the remove-format-assertions branch November 3, 2025 22:11
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