Sindbad~EG File Manager
�
)ΜgpE � �X � d dl Z d dlZd dlmZ ddlmZmZmZmZm Z d� Z
G d� de � Zy)� N)�support� )�
BREAKPOINT_FN�GDB_VERSION�run_gdb�setup_module�
DebuggerTestsc � � t � y �N)r � � �</usr/local/lib/python3.12/test/test_gdb/test_pretty_print.py�setUpModuler
s � ��Nr
c � � e Zd Z d!d�Zd� Zd"d�Z ej d� d� � Zd� Z d� Z
d � Z ej d� d
� � Z ej d� d� � Z
d� Z ej d� d
� � Z ej d� d� � Zd� Zd� Zd� Zd� Zd"d�Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d � Z"y)#�PrettyPrintTestsNc �� � |xs dg}| j |t ||�� }t j d|t j � }|s| j d|�d|��� |j
d� |fS )Nzbacktrace 1)�
breakpoint�cmds_after_breakpoint�import_sitezS#0\s+builtin_id\s+\(self\=.*,\s+v=\s*(.*?)?\)\s+at\s+\S*[A-Za-z]+/[A-Za-z0-9_-]+\.czUnexpected gdb output: �
r )�get_stack_tracer �re�search�DOTALL�fail�group)�self�sourcer r �
gdb_output�ms r �get_gdb_reprzPrettyPrintTests.get_gdb_repr sz � � !6� H�-����)�)�&�]�@U�6A� *� C�
�
�I�I�
6�
�� � �
#�� ��I�I��Z�P�Q��w�w�q�z�:�%�%r
c �T � | j d� }| j t |v � y )N�id(42))r �
assertTruer �r r s r �test_getting_backtracez'PrettyPrintTests.test_getting_backtrace3 s# � ��)�)�(�3�
����
��3�4r
c � � | j dt |� z dz � \ }}|st |� }| j |||�d|�d|��� y )Nzid(�)z did not equal expected z; full output was:
)r! �ascii�repr�assertEqual)r �val�exp_repr�gdb_reprr s r �
assertGdbReprzPrettyPrintTests.assertGdbRepr7 sQ � � $�0�0���s��1C�c�1I�J���*���C�y�H�����8�%�x��=� ?r
�cpuc � � | j d� | j d� | j d� | j d� | j d� y)z0Verify the pretty-printing of various int values�* r i����l J)�l���� �I�5 N�r/ �r s r �test_intzPrettyPrintTests.test_intA sK � �
���2�����1�����2�����=�)����,�-r
c �j � | j d� | j d� | j d� y)z2Verify the pretty-printing of True, False and NoneTFNr3 r4 s r �test_singletonsz PrettyPrintTests.test_singletonsJ s, � ����4� ����5�!����4� r
c �x � | j i � | j ddid� | j ddd�d� y)z*Verify the pretty-printing of dictionaries�foo�barz{'foo': 'bar'}r2 )r9 �douglasz{'foo': 'bar', 'douglas': 42}Nr3 r4 s r �
test_dictszPrettyPrintTests.test_dictsP s; � ����2�����E�5�>�+;�<����5�R�8�:Y�Zr
c �l � | j g � | j t t d� � � y)z#Verify the pretty-printing of lists� N)r/ �list�ranger4 s r �
test_listszPrettyPrintTests.test_listsW s&