Skip to content

Commit b06b266

Browse files
committed
Add test for tuple bounds
1 parent 76a3245 commit b06b266

File tree

2 files changed

+91
-0
lines changed

2 files changed

+91
-0
lines changed

parser/src/parser.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -656,6 +656,16 @@ class Foo[T: str](A, B):
656656
insta::assert_debug_snapshot!(ast::Suite::parse(source, "<test>").unwrap());
657657
}
658658

659+
#[test]
660+
#[cfg(feature = "all-nodes-with-ranges")]
661+
fn test_parse_class_with_generic_type_with_tuple_bound() {
662+
let source = "\
663+
class Foo[T: (str, bytes)](A, B):
664+
pass
665+
";
666+
insta::assert_debug_snapshot!(ast::Suite::parse(source, "<test>").unwrap());
667+
}
668+
659669
#[test]
660670
#[cfg(feature = "all-nodes-with-ranges")]
661671
fn test_parse_class_with_multiple_generic_types() {

parser/src/snapshots/rustpython_parser__parser__tests__parse_class_with_generic_type_with_tuple_bound.snap

Lines changed: 81 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)