-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Expand file tree
/
Copy pathcapsule-deps.test
More file actions
121 lines (93 loc) · 2.38 KB
/
capsule-deps.test
File metadata and controls
121 lines (93 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
[case testNoDeps]
def f() -> None:
pass
[out]
No deps
[case testStringsNoCapsuleDepWithoutExperimental]
# Test case missing _experimental suffix -> no deps
from librt.strings import StringWriter
def f() -> None:
StringWriter()
[out]
No deps
[case testStringsCapsuleDep_experimental]
from librt.strings import StringWriter
def f() -> None:
StringWriter()
[out]
Capsule(name='librt.strings')
[case testStringsCapsuleDepFromParamType_experimental]
from librt.strings import StringWriter
def f(s: StringWriter) -> None:
pass
[out]
Capsule(name='librt.strings')
[case testStringsCapsuleDepFromReturnType_experimental]
from librt.strings import StringWriter
def f() -> StringWriter:
assert False
[out]
Capsule(name='librt.strings')
[case testStringsCapsuleDepFromUnion_experimental]
from typing import Union
from librt.strings import StringWriter
def f(s: Union[StringWriter, str]) -> None:
pass
[out]
Capsule(name='librt.strings')
[case testStringsCapsuleDepFromTuple_experimental]
from librt.strings import StringWriter
def f(s: tuple[int, StringWriter]) -> None:
pass
[out]
Capsule(name='librt.strings')
[case testExtraFileDep_experimental]
from librt.strings import StringWriter
def f(s: StringWriter) -> int:
return s[0]
[out]
Capsule(name='librt.strings')
SourceDep(path='stringwriter_extra_ops.c')
[case testMultipleCapsuleDeps1_experimental]
from librt.strings import StringWriter
from librt.base64 import b64encode
def f() -> None:
StringWriter()
def g() -> bytes:
return b64encode(b'foo')
[out]
Capsule(name='librt.base64')
Capsule(name='librt.strings')
[case testMultipleCapsuleDeps2_experimental]
from librt.strings import StringWriter
from librt.base64 import b64encode
def f() -> bytes:
StringWriter()
return b64encode(b'foo')
[out]
Capsule(name='librt.base64')
Capsule(name='librt.strings')
[case testVecCapsuleDepInFunction_experimental]
from librt.vecs import vec
def f() -> None:
vec[str]()
[out]
Capsule(name='librt.vecs')
[case testVecCapsuleDepInMethod_experimental]
from librt.vecs import vec
class C:
def m(self) -> None:
vec[str]()
[out]
Capsule(name='librt.vecs')
[case testVecCapsuleDepAtTopLevel_experimental]
from librt.vecs import vec
vec[str]()
[out]
Capsule(name='librt.vecs')
[case testVecCapsuleDepInAttributeType_experimental]
from librt.vecs import vec
class C:
v: vec[str]
[out]
Capsule(name='librt.vecs')