-
Notifications
You must be signed in to change notification settings - Fork 53
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
test: Fix up doc tests and run them on CI #1057
base: next
Are you sure you want to change the base?
Conversation
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.
Looks good to me!
Thanks for fixing the mock chain ones as well, I hadn't seen those. I think I was running without --testing
.
/// .unwrap(); | ||
/// mock_chain.seal_block(None); | ||
/// let tx_context = mock_chain.build_tx_context(sender.id(), &[note.id()], &[]).build(); | ||
/// // tx_context.execute(); |
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.
If we can't make it a full example and have to comment this line, should we just add no_run
(https://doc.rust-lang.org/rustdoc/write-documentation/documentation-tests.html#attributes)? That way it's compiled but not executed which seems fine here.
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.
Ah yes, that sounds good.
/// let template = AccountComponentTemplate::new(component_template, library); | ||
/// | ||
/// let component = AccountComponent::from_template(&template, &init_storage_data)?; | ||
/// # Ok(()) | ||
/// # } | ||
/// ``` | ||
|
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.
What do you think about moving this example to the type-level, e.g. on AccountComponentMetadata
directly for more visibility?
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.
Agreed!
No description provided.