MCPcopy Create free account
hub / github.com/astral-sh/ruff / nested_binary_expression

Function nested_binary_expression

crates/ruff_python_formatter/src/comments/mod.rs:1057–1073  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1055
1056 #[test]
1057 fn nested_binary_expression() {
1058 let source = r"
1059a = (
1060 (5 # trailing left comment
1061 *
1062 2)
1063 + # trailing operator comment
1064 # leading right comment
1065 3
1066)
1067";
1068 let test_case = CommentsTestCase::from_code(source);
1069
1070 let comments = test_case.to_comments();
1071
1072 assert_debug_snapshot!(comments.debug(test_case.source_code));
1073 }
1074
1075 #[test]
1076 fn while_trailing_end_of_line_comment() {

Callers

nothing calls this directly

Calls 1

to_commentsMethod · 0.80

Tested by

no test coverage detected