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

Function test_integer_overflow

tests/test_security_inputs.py:337–348  ·  view source on GitHub ↗

Very large integer strings must not crash, return int or None.

()

Source from the content-addressed store, hash-verified

335# ══════════════════════════════════════════════════════════════════════
336
337def test_integer_overflow():
338 """Very large integer strings must not crash, return int or None."""
339 def run():
340 big = "9" * 1000
341 r = parse("{:d}", big)
342 if r is None:
343 return None
344 return r[0]
345 result = _check_no_crash(run)
346 # Accept either: Python int (upstream) or str (parse-rust fallback for >i64)
347 # The key property: no crash, no panic, no hang
348 assert result is None or isinstance(result, (int, str))
349
350
351def test_float_edge_values():

Callers

nothing calls this directly

Calls 1

_check_no_crashFunction · 0.85

Tested by

no test coverage detected