Skip to content

Add tests for C objects.inv #2934

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
merged 7 commits into from
Apr 15, 2025
Merged

Add tests for C objects.inv #2934

merged 7 commits into from
Apr 15, 2025

Conversation

frankharkins
Copy link
Member

Closes #2884.

Also handles some weird entries (see #2907 (comment)).

@frankharkins frankharkins linked an issue Apr 8, 2025 that may be closed by this pull request
Comment on lines +157 to +166
// We sometimes get anchors of the form
// 'structQkObsTerm_1a14ff1665641903565439ad9877fd2c8e' and
// 'structQkObsTerm_1autotoc_md2', we just map these to the object.
const maybeStructAutoTocMatch =
uri.match(/struct([A-z]+)_(\dautotoc_|[\dabcdef]{34})/) ||
uri.match(/struct([A-Z][A-z]+)$/);
if (maybeStructAutoTocMatch) {
const objectName = maybeStructAutoTocMatch[1].toLowerCase();
return `${path}#${objectName}`;
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This is best-effort, it seems to work with the current C API, but we can adjust if we hit more edge cases. This should not affect the Python API.

@frankharkins frankharkins marked this pull request as ready for review April 15, 2025 15:16
Copy link
Collaborator

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

👏

Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
@frankharkins frankharkins enabled auto-merge April 15, 2025 15:47
@frankharkins frankharkins added this pull request to the merge queue Apr 15, 2025
Merged via the queue into main with commit 1593e1c Apr 15, 2025
3 checks passed
@frankharkins frankharkins deleted the FH/c-objinv-tests branch April 15, 2025 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Clean up link ignores post-Qiskit 2.0 Add tests for C objects.inv handling
2 participants