← Back
Editing: test_tokenutil.cpython-311.pyc
� �@�cN � � � d Z ddlZddlmZmZ d� Zd� Zd� Zd� Zd� Z d � Z d � Zd� Zej � d e e ed d� � � � e edd� � � � z dgdz dgdz z � � � � d� � � ZdS )zTests for tokenutil� N)�token_at_cursor�line_at_cursorc � � t ||� � }d}|� � � D ]/}|t |� � z |k r n|t |� � dz z }�0||z }|d |� �d||d � ��}|| k sJ d| |||fz � � �d S )Nr � �|z#Expected %r, got %r in: %r (pos %i))r � splitlines�len)�expected�cell� cursor_pos�token�offset�line�column�line_with_cursors �D/usr/lib/python3/dist-packages/IPython/utils/tests/test_tokenutil.py�expect_tokenr s� � ��D�*�-�-�E� �F����!�!� "� "���C��I�I���+�+��E��c�$�i�i��k�!�F�F� �&� �F�"&�w��w�-�-�-��f�g�g���?���H����C�� ��� G� ������ c �j � d} t t | � � � � D ]}t d| |� � �d S )N�foo)�ranger r )r �is r �test_simpler sC � ��D� �3�t�9�9� � � %� %���U�D�!�$�$�$�$�%� %r c � � d} d}t | � d� � dz � � D ]}t d| |� � �| � d� � dz | � d� � dz fD ]}t d| |� � �t | � d� � | � d� � � � D ]}t d| |� � �d S )Nzfoo(a=5, b='10')r �a=r �=�,zb=)r �findr �rfind)r r r s r � test_functionr s� � ��D��H� �4�9�9�T�?�?�Q�&� '� '� %� %���U�D�!�$�$�$�$��i�i��n�n�q� �$�*�*�S�/�/�A�"5� 6� %� %���U�D�!�$�$�$�$� �4�9�9�S�>�>�4�9�9�T�?�?� 3� 3� %� %���U�D�!�$�$�$�$�%� %r c �l � d� ddg� � } d}| � |� � dz }t ||t |� � z � � D ]}t || |� � �d}| � |� � dz }t ||t |� � z � � D ]}t || |� � �d S )N� za = 5�b = hello("string", there)�hellor ��join�indexr r r �r r �startr s r �test_multiliner* - s� � ��9�9��$�� � �D� �H��J�J�x� � �1�$�E� �5�%�#�h�-�-�/� 0� 0� (� (���X�t�Q�'�'�'�'��H��J�J�x� � �1�$�E� �5�%�#�h�-�-�/� 0� 0� (� (���X�t�Q�'�'�'�'�(� (r c �l � d� g d�� � } d}| � |� � dz }t ||t |� � z � � D ]}t || |� � �d}| � |� � dz }t ||t |� � z � � D ]}t || |� � �d S )Nr"