-
Notifications
You must be signed in to change notification settings - Fork 303
Ruff depth limit #391
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
base: main
Are you sure you want to change the base?
Ruff depth limit #391
Changes from 2 commits
57fb4ef
24fd47b
e699ad6
8d06e98
30be6aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚩 Stale The docstring at lines 68-69 of Was this helpful? React with 👍 or 👎 to provide feedback. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| use insta::assert_snapshot; | ||
| use monty::MontyRun; | ||
|
|
||
| #[test] | ||
| fn deeply_nested_parentheses_do_not_stack_overflow() { | ||
| let depth = 5000; | ||
| let mut code = String::with_capacity(depth * 2 + 1); | ||
| for _ in 0..depth { | ||
| code.push('('); | ||
| } | ||
| code.push('1'); | ||
| for _ in 0..depth { | ||
| code.push(')'); | ||
| } | ||
| let result = MontyRun::new(code, "test.py", vec![]); | ||
| let err = result.expect_err("expected parse error for deeply nested parentheses"); | ||
| assert_snapshot!(err.message().unwrap_or(""), @"Source is too deeply nested for the parser at byte range 199..200"); | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.