use crate::typing::tests::TypeCheck;
#[test]
fn test_type_alias() {
TypeCheck::new().ty("x").check(
"type_alias",
r#"
MyList = list[int]
def f(x: MyList):
pass
"#,
);
}
#[test]
fn test_incorrect_type_dot() {
TypeCheck::new().check(
"incorrect_type_dot",
r#"
def foo(x: list.foo.bar):
pass
"#,
);
}
#[test]
fn test_function_as_type_bit_or() {
TypeCheck::new().ty("t").check(
"function_as_type_bit_or",
r#"
def test():
# This test should work even if `t` is global. There's a bug in test framework somewhere.
t = int | str
"#,
);
}