-
Notifications
You must be signed in to change notification settings - Fork 147
[test only] Combine many of the various SGF test helpers #955
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
d-ronnqvist
merged 8 commits into
swiftlang:main
from
d-ronnqvist:unify-symbol-test-helpers
Aug 20, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ca93e1e
Combine a handful of SGF test helper functions
d-ronnqvist 64ec387
Use shorter parameter names in new SGF test helper
d-ronnqvist 7320ef1
Merge branch 'main' into unify-symbol-test-helpers
d-ronnqvist 877a6f5
Update default line list source position value to be different from e…
d-ronnqvist a3fa1db
Merge branch 'main' into unify-symbol-test-helpers
d-ronnqvist 82d6324
Remove unused local variable
d-ronnqvist bfcb7f4
Merge branch 'main' into unify-symbol-test-helpers
d-ronnqvist d996998
Merge branch 'main' into unify-symbol-test-helpers
d-ronnqvist File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're duplicating these defaults 3 times in this file, it would be nice if we only used them once. I think here we could make it a non-optional value and save us needing to have defaults later on:
https://github.com/apple/swift-docc/blob/64ec387cab27ce898f74df36eff2d0d548b77658/Sources/SwiftDocCTestUtilities/SymbolGraphCreation.swift#L108-L109
and then we won't need the defaults:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some cases where real world data doesn't have a location, for example if the symbol graph was extracted from a binary instead of from source code.
I prefer to keep the ability to create such a value. The idea is that
makeLineList
,makeMixins
,makeMetadata
,makeModule
, etc. all should be usable from any test. That's why each of them duplicate the default values so that the caller doesn't have to.