Add multiline type alias tests with line continuations

This commit is contained in:
Zanie 2023-07-14 11:59:43 -05:00
parent 7bbd80eb6c
commit 1622c8f2da
2 changed files with 80 additions and 0 deletions

View file

@ -912,6 +912,14 @@ type X[T: (int, str), *Ts, **P] = (T, Ts, P)
type type = int
type match = int
type case = int
# multine definitions
type \
X = int
type X \
= int
type X = \
int
"#;
insta::assert_debug_snapshot!(ast::Suite::parse(source, "<test>").unwrap());
}

View file

@ -634,4 +634,76 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
),
},
),
TypeAlias(
StmtTypeAlias {
range: 367..382,
name: Name(
ExprName {
range: 375..376,
id: Identifier(
"X",
),
ctx: Load,
},
),
type_params: [],
value: Name(
ExprName {
range: 379..382,
id: Identifier(
"int",
),
ctx: Load,
},
),
},
),
TypeAlias(
StmtTypeAlias {
range: 383..398,
name: Name(
ExprName {
range: 388..389,
id: Identifier(
"X",
),
ctx: Load,
},
),
type_params: [],
value: Name(
ExprName {
range: 395..398,
id: Identifier(
"int",
),
ctx: Load,
},
),
},
),
TypeAlias(
StmtTypeAlias {
range: 399..414,
name: Name(
ExprName {
range: 404..405,
id: Identifier(
"X",
),
ctx: Load,
},
),
type_params: [],
value: Name(
ExprName {
range: 411..414,
id: Identifier(
"int",
),
ctx: Load,
},
),
},
),
]