+
    ¾¾jå
  ã                   ó  € R t ^ RIt^ RIHtHt R R lt]P                  P                  R. RO4      ]P                  P                  R]]	.RR.R	7      R
 4       4       t
]P                  P                  R. RO4      R 4       tR tR# )a#  Regression test for repr() RecursionError on deeply-nested calendars.

See https://github.com/collective/icalendar/issues/1370.

A crafted ``.ics`` payload of only ~13 KB nesting ``BEGIN:VEVENT``
many levels deep used to make ``repr()`` / ``str()`` / ``f"{cal}"``
raise an uncaught ``RecursionError`` at default recursion limit (1000).

The parser itself is iterative and accepts the input fine; only the
``Component.__repr__`` traversal was recursive. This test exercises both
moderate (default-recursion-limit-breaking) and pathological depths.
N)ÚCalendarÚEventc                ó0   € V ^8„  d   QhR\         R\        /# )é   ÚdepthÚreturn)ÚintÚstr)Úformats   "Úb/home/ralf/ical-fahrzeuge/venv/lib/python3.14/site-packages/icalendar/tests/test_repr_recursion.pyÚ__annotate__r      s   € ÷ 'ñ '¤ð '¬ñ 'ó    c                ó¨   € . ROpVR.V ,          ,          pVRR.,          pVR.V ,          ,          pVR.,          pRP                  V4      R,           # )z>Return an .ics payload with ``depth`` levels of nested VEVENT.zBEGIN:VEVENTzUID:nested@example.comzDTSTAMP:20260101T000000Zz
END:VEVENTzEND:VCALENDARz
)zBEGIN:VCALENDARzVERSION:2.0zPRODID:-//test//test//EN)Újoin)r   Úliness   & r   Ú_make_nested_calendarr      s\   € âJ€EØ	ˆnÐ Õ%Õ%€EØ	Ð&Ð(BÐCÕC€EØ	ˆlˆ^˜eÕ#Õ#€EØ	ˆoÐÕ€EØ�;‰;�uÓ Õ&Ð&r   r   ÚfnÚreprr	   )Úidsc                óì   € \        V4      p\        P                  ! V4      pV ! V4      pVP                  R4      '       g   Q hVP	                  R4      '       g   Q hVP                  R4      V8X  g   Q hR# )z¬``repr()`` and ``str()`` must not raise ``RecursionError``
regardless of nesting depth. ``str()`` falls through to ``__repr__``,
so the same depths are exercised for both.
z
VCALENDAR(Ú)zVEVENT(N)r   r   Ú	from_icalÚ
startswithÚendswithÚcount)r   r   ÚicsÚcalÚresults   &&   r   Ú.test_repr_and_str_do_not_raise_recursion_errorr      sj   € ô   Ó
&€CÜ
×
Ò
˜SÓ
!€Cá�‹W€FØ×Ñ˜\×*Ò*Ð*Ð*Ø�?‰?˜3×ÒÐÐà�<‰<˜	Ó" eÔ+Ð+Ò+r   c                óê   € \        4       pTp\        V 4       F   p\        4       pVP                  V4       TpK"  	  RRV ,          ,           RV ^,           ,          ,           p\	        V4      V8X  g   Q hR# )a)  The exact ``repr()`` string matches the format produced by the
previous (recursive) implementation: ``VCALENDAR({}, VEVENT({}, ...))``.

Built from empty :class:`Component` instances so the expected output
can be spelled out exactly without depending on the ``repr`` of any
parsed property value.
zVCALENDAR({}z, VEVENT({}r   N)r   Úranger   Úadd_componentr   )r   r   ÚparentÚ_ÚchildÚexpecteds   &     r   Ú,test_repr_exact_output_for_nested_componentsr&   .   si   € ô ‹*€CØ€FÜ�5Ž\ˆÜ“ˆØ×Ñ˜UÔ#ØŠñ ð  °Õ 5Õ5¸¸uÀq½yÕ8IÕI€HÜ�‹9˜Ô Ð Ò r   c                 ó¢   € \        4       p V P                  \        4       4       V P                  \        4       4       \        V 4      R8X  g   Q hR# )zˆThe exact ``repr()`` string for sibling subcomponents matches the
previous recursive format: ``VCALENDAR({}, VEVENT({}), VEVENT({}))``.
z%VCALENDAR({}, VEVENT({}), VEVENT({}))N)r   r!   r   r   )r   s    r   Ú-test_repr_exact_output_for_sibling_componentsr(   A   s>   € ô ‹*€CØ×Ñ”e“gÔØ×Ñ”e“gÔÜ�‹9Ð?Ô?Ð?Ò?r   )é
   éd   éô  éè  )é   r   r)   r+   r,   )Ú__doc__ÚpytestÚ	icalendarr   r   r   ÚmarkÚparametrizer   r	   r   r&   r(   © r   r   Ú<module>r4      s�   ðñó ç %õ'ð ‡�×Ñ˜Ò"6Ó7Ø‡�×Ñ˜  c˜{°¸°ÐÓ@ñ,ó Aó 8ð,ð ‡�×Ñ˜Ò"7Ó8ñ!ó 9ð!ô$@r   