Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Commit f50d06a

Browse files
committed
Add test
1 parent ac1f6bd commit f50d06a

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

parser/src/parser.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1099,5 +1099,23 @@ def args_to_tuple(*args: *Ts) -> Tuple[*Ts]: ...
10991099
fn test_parse_identifier() {
11001100
let i = ast::Identifier::parse_without_path("test").unwrap();
11011101
assert_eq!(i.as_str(), "test");
1102+
1103+
#[cfg(not(feature = "all-nodes-with-ranges"))]
1104+
fn decorator_ranges() {
1105+
let parse_ast = parse_program(
1106+
r#"
1107+
@my_decorator
1108+
def test():
1109+
pass
1110+
1111+
@class_decorator
1112+
class Abcd:
1113+
pass
1114+
"#
1115+
.trim(),
1116+
"<test>",
1117+
)
1118+
.unwrap();
1119+
insta::assert_debug_snapshot!(parse_ast);
11021120
}
11031121
}

parser/src/snapshots/rustpython_parser__parser__tests__decorator_ranges.snap

Lines changed: 72 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)