-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix(coverage): treat assert/require as lines instead branch #8413
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.
great!
let expr: Option<Node> = node.attribute("expression"); | ||
if let Some(NodeType::Identifier) = expr.as_ref().map(|expr| &expr.node_type) { | ||
// Might be a require/assert call | ||
let name: Option<String> = expr.and_then(|expr| expr.attribute("name")); | ||
if let Some("assert" | "require") = name.as_deref() { | ||
self.push_branches(&node.src, self.branch_id); | ||
self.branch_id += 1; | ||
} | ||
} |
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 okay, this is now no longer required because all this did was check for assert | require
@mattsse @grandizzy @DaniPopes I think There is a subtle difference between
There is a semantic difference and it's very well highlighted in the solidity docs:
There is also a concrete/practical difference - the
Does this make sense? |
Motivation
Closes #4294
Solution
self.push_item
as a statement)