ó {G_Tc @ s d d l Z d d l m Z m Z d d l Z d d l Z d d l Z d e j f d „ ƒ YZ d e j f d „ ƒ YZ d e j f d „ ƒ YZ d Z d Z d Z d Z d Z d Z d e j f d „ ƒ YZ d e j f d „ ƒ YZ d „ Z e d k re ƒ n d S( iÿÿÿÿN( t run_unittestt findfilet TestWithAsciic B s e Z d „ Z d „ Z RS( c C sÍ t j d d d d d d ƒ } | j | j ƒ d d d ƒ| j t | j ƒ ƒ d d g ƒ t j d d d d d d d d ƒ } | j | j ƒ d d d ƒ| j t | j ƒ ƒ d d d g ƒ d S( Nt bid t ag×£p= ×ï?t placesi t inserti i t equalie i2 i3 ( s inserti i i i ( R i id i ie ( R i i2 i i2 ( s inserti2 i2 i2 i3 ( R i2 id i3 ie ( t difflibt SequenceMatchert Nonet assertAlmostEqualt ratiot assertEqualt listt get_opcodes( t selft sm( ( s- /usr/local/lib/python2.7/test/test_difflib.pyt test_one_insert s ! )c C sv t j d d d d d d d d d d ƒ } | j | j ƒ d d d ƒ| j t | j ƒ ƒ d d d g ƒ d S( NR i( t cR g+‡ÙÎï?R i R i t deletei) iQ iP ( s equali i( i i( ( R i( i) i( i( ( s equali) iQ i( iP ( R R R R R R R R ( R R ( ( s- /usr/local/lib/python2.7/test/test_difflib.pyt test_one_delete s 1( t __name__t __module__R R ( ( ( s- /usr/local/lib/python2.7/test/test_difflib.pyR s t TestAutojunkc B s e Z d Z d „ Z RS( s- Tests for the autojunk parameter added in 2.7c C s„ d d } d d d } t j d | | ƒ } | j | j ƒ d d d ƒt j d | | d t ƒ} | j | j ƒ d d d ƒd S( NR iÈ R i R i t autojunkgìQ¸…ëï?( R R R R R t False( R t seq1t seq2R ( ( s- /usr/local/lib/python2.7/test/test_difflib.pyt# test_one_insert_homogenous_sequence! s ( R R t __doc__R ( ( ( s- /usr/local/lib/python2.7/test/test_difflib.pyR s t TestSFbugsc B s, e Z d „ Z d „ Z d „ Z d „ Z RS( c C s[ t j d g g ƒ } | j | j ƒ d ƒ | j | j ƒ d ƒ | j | j ƒ d ƒ d S( Ni ( R R R R R t quick_ratiot real_quick_ratio( R t s( ( s- /usr/local/lib/python2.7/test/test_difflib.pyt test_ratio_for_null_seqn0 s c C sW t j d g g ƒ j ƒ } | j t | j ƒ t j g g ƒ } | j t | j ƒ d S( N( R R R t get_grouped_opcodest assertRaisest StopIterationt nextt unified_diff( R t group_gent diff_gen( ( s- /usr/local/lib/python2.7/test/test_difflib.pyt test_comparing_empty_lists7 s c C sv t j d d d ƒ } | j ƒ } | j ƒ } | j | d j d ƒ | j | d j d ƒ | j | d j d ƒ d S( Nt abxcdt abcdi i i ( R R R t get_matching_blocksR t size( R R" t firstt second( ( s- /usr/local/lib/python2.7/test/test_difflib.pyt test_matching_blocks_cache> s c C sx t t j ƒ j d g d g ƒ ƒ } | j d | d ƒ | j d | d ƒ | j d | d ƒ | j d | d ƒ d S( Ns I am a buggys I am a bugs - I am a buggyi s ? -- i s + I am a bugi s ? + i ( R R t Differt compareR ( R t diff( ( s- /usr/local/lib/python2.7/test/test_difflib.pyt test_added_tab_hintG s $( R R R# R+ R2 R6 ( ( ( s- /usr/local/lib/python2.7/test/test_difflib.pyR / s s 1. Beautiful is beTTer than ugly. 2. Explicit is better than implicit. 3. Simple is better than complex. 4. Complex is better than complicated. s™ 1. Beautiful is better than ugly. 3. Simple is better than complex. 4. Complicated is better than complex. 5. Flat is better than nested. sÞ Line 1: preceeded by from:[tt] to:[ssss] Line 2: preceeded by from:[sstt] to:[sssst] Line 3: preceeded by from:[sstst] to:[ssssss] Line 4: has from:[sst] to:[sss] after : Line 5: has from:[t] to:[ss] at end sá Line 1: preceeded by from:[tt] to:[ssss] Line 2: preceeded by from:[sstt] to:[sssst] Line 3: preceeded by from:[sstst] to:[ssssss] Line 4: has from:[sst] to:[sss] after : Line 5: has from:[t] to:[ss] at end sô line 0 1234567890123456789012345689012345 line 1 line 2 line 3 line 4 changed line 5 changed line 6 changed line 7 line 8 subtracted line 9 1234567890123456789012345689012345 short line just fits in!! just fits in two lines yup!! the endsù line 0 1234567890123456789012345689012345 line 1 line 2 added line 3 line 4 chanGEd line 5a chanGed line 6a changEd line 7 line 8 line 9 1234567890 another long line that needs to be wrapped just fitS in!! just fits in two lineS yup!! the endt TestSFpatchesc B s e Z d „ Z d „ Z RS( c C sÎ t d d d } t d d d } d d | } d d | } | j ƒ } | j ƒ } | j ƒ } | j ƒ } t j ƒ } t j ƒ } t } t } t j ƒ } t j d d ƒ } t j d d ƒ } | j | | d d d t d d ƒ} d j d | j | | d d d t ƒd | j | | d d d t ƒd | j | | d d d t d d ƒd | j | | d d d t d d ƒd | j | | d d d t ƒd | j | | d d d t ƒd | j g g d d d t ƒd | j g g d d d t ƒd | j | | ƒ d | j | | ƒ d | j | j ƒ | j ƒ d t d d ƒd | j | j ƒ | j ƒ ƒ d | j | j t ƒ | j t ƒ ƒ g ƒ } | j d d | ƒ } t t d ƒ ƒ } | j | | j ƒ ƒ Wd QXd S(! Ns 123 i i s 456 t tabsizei t wrapcolumni t fromt tot contextt numlinesi s s8