MCPcopy Create free account
hub / github.com/coooodeer/parse-rust / test_deeply_nested_fields_compile

Function test_deeply_nested_fields_compile

tests/test_security_inputs.py:187–199  ·  view source on GitHub ↗

A format with deep nested fields must compile.

()

Source from the content-addressed store, hash-verified

185NESTING_DEPTH = 8
186
187def test_deeply_nested_fields_compile():
188 """A format with deep nested fields must compile."""
189 parts = []
190 for i in range(NESTING_DEPTH):
191 parts.append(f"level_{i}")
192 key_path = "[" + "][".join(f'"{p}"' for p in parts) + "]"
193 fmt = f"{{{key_path}}}"
194
195 def run():
196 p = compile(fmt)
197 return p.named_fields
198 result = _check_no_crash(run)
199 assert result is not None
200
201
202def test_deeply_nested_fields_parse():

Callers

nothing calls this directly

Calls 1

_check_no_crashFunction · 0.85

Tested by

no test coverage detected