Skip to content
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

Feat: Add manual assert #101

Closed

Conversation

stevencartavia
Copy link
Contributor

if let Expr::InlineMacro(inline_macro) = &statement_expr.expr(db) {
let panic_message = inline_macro.arguments(db).as_syntax_node().get_text_without_trivia(db);
let condition_text = condition.as_syntax_node().get_text_without_trivia(db);
let assert_condition = condition_text.trim_start_matches('!');
Copy link
Contributor

Choose a reason for hiding this comment

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

don't do that, take the if condition from the Expr::If

Comment on lines 523 to 524
panic_message.trim_matches(&['(', ')'][..]).replace("\"", "").trim(),
condition_text.split('.').next().unwrap_or(&condition_text),
Copy link
Contributor

Choose a reason for hiding this comment

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

what is that ?

@@ -0,0 +1,79 @@
//! > check-if-then
Copy link
Contributor

Choose a reason for hiding this comment

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

add more tests for example one with if else don't only check the happy path you need to think of edge cases

@0xLucqs
Copy link
Contributor

0xLucqs commented Oct 2, 2024

Hey i'll close this, as there's still plenty of work to do and we won't have time to do it by the end of the week. I'll still pay you though

@0xLucqs 0xLucqs closed this Oct 2, 2024
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.

Add manual_assert
2 participants