Skip to content

Commit 719ecaf

Browse files
committed
more tests
1 parent e9e2787 commit 719ecaf

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

crates/ty_python_semantic/resources/mdtest/protocols.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,10 @@ class SupportsStr(Protocol):
995995

996996
static_assert(is_equivalent_to(SupportsStr, UniversalSet))
997997
static_assert(is_equivalent_to(SupportsStr, object))
998+
static_assert(is_subtype_of(SupportsStr, UniversalSet))
999+
static_assert(is_subtype_of(UniversalSet, SupportsStr))
1000+
static_assert(is_assignable_to(UniversalSet, SupportsStr))
1001+
static_assert(is_assignable_to(SupportsStr, UniversalSet))
9981002

9991003
class SupportsClass(Protocol):
10001004
@property
@@ -1003,6 +1007,11 @@ class SupportsClass(Protocol):
10031007
static_assert(is_equivalent_to(SupportsClass, UniversalSet))
10041008
static_assert(is_equivalent_to(SupportsClass, SupportsStr))
10051009
static_assert(is_equivalent_to(SupportsClass, object))
1010+
1011+
static_assert(is_subtype_of(SupportsClass, SupportsStr))
1012+
static_assert(is_subtype_of(SupportsStr, SupportsClass))
1013+
static_assert(is_assignable_to(SupportsStr, SupportsClass))
1014+
static_assert(is_assignable_to(SupportsClass, SupportsStr))
10061015
```
10071016

10081017
If a protocol contains members that are not defined on `object`, then that protocol will (like all

0 commit comments

Comments
 (0)