File: //lib64/python3.6/test/__pycache__/test_peepholer.cpython-36.pyc
3
\�2 � @ sj d dl Z d dlZd dlZd dlZd dlZd dlmZ G dd� de�ZG dd� dej�Z e
dkrfej� dS )� N)�BytecodeTestCasec @ s� e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� Zdd� Zd
d� Z dd� Z
dd� Zdd� Zdd� Z
dd� Zdd� Zdd� Zdd� Zdd � Zd!d"� Zd#S )$�
TestTranformsc C s0 dd� }| j |d� | j |d� | j|d� d S )Nc S s | dks
~ d S )N� � )�xr r �&/usr/lib64/python3.6/test_peepholer.py�unot
s z%TestTranforms.test_unot.<locals>.unotZ UNARY_NOT�POP_JUMP_IF_FALSEZPOP_JUMP_IF_TRUE)�assertNotInBytecode�assertInBytecode)�selfr r r r � test_unot s zTestTranforms.test_unotc C s0 x*dD ]"\}}t |d d
�}| j|d|� qW d S )N�
not a is b�is not�
not a in b�not in�not a is not b�is�not a not in b�in� �singleZ
COMPARE_OP�r r �r r �r r �r r )r r r r )�compiler )r �lineZcmp_op�coder r r �test_elim_inversion_of_is_or_in s z-TestTranforms.test_elim_inversion_of_is_or_inc C s| dd� }dd� }dd� }x<|d f|df|dffD ]"\}}| j |d � | j|d
|� q0W dd� }| j |d � | j|d
d � d S )Nc S s d } d } | S )Nr )r r r r �f s z0TestTranforms.test_global_as_constant.<locals>.fc S s d} | S )NTr )r r r r �g$ s z0TestTranforms.test_global_as_constant.<locals>.gc S s d} | S )NFr )r r r r �h'