1
- includes = [" folly/FBString.h" ]
1
+ includes = [" folly/FBString.h" , " utility " ]
2
2
[cases ]
3
3
[cases .empty ]
4
- oil_skip = ' not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/322
5
4
param_types = [" folly::fbstring&" ]
6
5
setup = " return {};"
7
6
expect_json = '''
@@ -18,16 +17,22 @@ includes = ["folly/FBString.h"]
18
17
"dynamicSize": 0,
19
18
"exclusiveSize": 24,
20
19
"length": 0,
21
- "capacity": 23,
20
+ "capacity":23,
22
21
"elementStaticSize": 1
23
22
}
24
23
]
25
24
}
26
25
]
27
26
'''
27
+ expect_json_v2 = ''' [{
28
+ "typeNames": ["folly::basic_fbstring<int8_t, std::char_traits<int8_t>, std::allocator<int8_t>, folly::fbstring_core<int8_t>>"],
29
+ "staticSize": 24,
30
+ "exclusiveSize": 24,
31
+ "length": 0,
32
+ "capacity": 23
33
+ }]'''
28
34
29
35
[cases .inline ]
30
- oil_skip = ' not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/322
31
36
param_types = [" folly::fbstring&" ]
32
37
setup = ' return {"012345"};'
33
38
expect_json = '''
@@ -51,9 +56,15 @@ includes = ["folly/FBString.h"]
51
56
}
52
57
]
53
58
'''
59
+ expect_json_v2 = ''' [{
60
+ "typeNames": ["folly::basic_fbstring<int8_t, std::char_traits<int8_t>, std::allocator<int8_t>, folly::fbstring_core<int8_t>>"],
61
+ "staticSize": 24,
62
+ "exclusiveSize": 24,
63
+ "length": 6,
64
+ "capacity": 23
65
+ }]'''
54
66
55
67
[cases .heap_allocated ]
56
- oil_skip = ' not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/322
57
68
param_types = [" folly::fbstring&" ]
58
69
setup = ' return {"abcdefghijklmnopqrstuvwxzy"};'
59
70
expect_json = '''
@@ -77,9 +88,15 @@ includes = ["folly/FBString.h"]
77
88
}
78
89
]
79
90
'''
91
+ expect_json_v2 = ''' [{
92
+ "typeNames": ["folly::basic_fbstring<int8_t, std::char_traits<int8_t>, std::allocator<int8_t>, folly::fbstring_core<int8_t>>"],
93
+ "staticSize": 24,
94
+ "exclusiveSize": 50,
95
+ "length": 26,
96
+ "capacity": 26
97
+ }]'''
80
98
81
- [cases .string_pooled ]
82
- oil_skip = ' not implemented for treebuilder v2' # https://github.com/facebookexperimental/object-introspection/issues/322
99
+ [cases .string_pooled_unique ]
83
100
param_types = [" folly::fbstring&" ]
84
101
setup = " return folly::fbstring(1024, 'c');"
85
102
expect_json = '''
@@ -103,3 +120,36 @@ includes = ["folly/FBString.h"]
103
120
}
104
121
]
105
122
'''
123
+ expect_json_v2 = ''' [{
124
+ "typeNames": ["folly::basic_fbstring<int8_t, std::char_traits<int8_t>, std::allocator<int8_t>, folly::fbstring_core<int8_t>>"],
125
+ "staticSize": 24,
126
+ "exclusiveSize": 1056,
127
+ "length": 1024,
128
+ "capacity": 1024
129
+ }]'''
130
+
131
+ [cases .string_pooled_shared ]
132
+ param_types = [" std::pair<folly::fbstring, folly::fbstring>&" ]
133
+ setup = """
134
+ folly::fbstring s(1024, 'c');
135
+ return {{s, s}};
136
+ """
137
+ expect_json_v2 = ''' [{
138
+ "staticSize": 48,
139
+ "exclusiveSize": 0,
140
+ "members": [
141
+ {
142
+ "typeNames": ["folly::basic_fbstring<int8_t, std::char_traits<int8_t>, std::allocator<int8_t>, folly::fbstring_core<int8_t>>"],
143
+ "staticSize": 24,
144
+ "exclusiveSize": 1056,
145
+ "length": 1024,
146
+ "capacity": 1024
147
+ }, {
148
+ "typeNames": ["folly::basic_fbstring<int8_t, std::char_traits<int8_t>, std::allocator<int8_t>, folly::fbstring_core<int8_t>>"],
149
+ "staticSize": 24,
150
+ "exclusiveSize": 24,
151
+ "length": 1024,
152
+ "capacity": 1024
153
+ }
154
+ ]
155
+ }]'''
0 commit comments