<s> import unittest <EOL> from collections import namedtuple <EOL> from Vintageous . vi . text_objects import word_reverse <EOL> from Vintageous . vi . utils import modes <EOL> from Vintageous . tests import first_sel <EOL> from Vintageous . tests import ViewTest <EOL> test_data = namedtuple ( '<STR_LIT>' , '<STR_LIT>' ) <EOL> TESTS = ( <EOL> test_data ( content = '<STR_LIT:abc>' , args = ( <NUM_LIT:2> , <NUM_LIT:1> ) , expected = <NUM_LIT:0> , msg = '<STR_LIT>' ) , <EOL> test_data ( content = '<STR_LIT>' , args = ( <NUM_LIT:8> , <NUM_LIT:1> ) , expected = <NUM_LIT:4> , msg = '<STR_LIT>' ) , <EOL> test_data ( content = '<STR_LIT>' , args = ( <NUM_LIT:8> , <NUM_LIT:2> ) , expected = <NUM_LIT:0> , msg = '<STR_LIT>' ) , <EOL> test_data ( content = '<STR_LIT>' , args = ( <NUM_LIT:8> , <NUM_LIT:1> ) , expected = <NUM_LIT:4> , msg = '<STR_LIT>' ) , <EOL> test_data ( content = '<STR_LIT>' , args = ( <NUM_LIT:5> , <NUM_LIT:1> ) , expected = <NUM_LIT:4> , msg = '<STR_LIT>' ) , <EOL> test_data ( content = '<STR_LIT>' , args = ( <NUM_LIT:6> , <NUM_LIT:1> ) , expected = <NUM_LIT:4> , msg = '<STR_LIT>' ) , <EOL> test_data ( content = '<STR_LIT>' , args = ( <NUM_LIT:6> , <NUM_LIT:1> ) , expected = <NUM_LIT:4> , msg = '<STR_LIT>' ) , <EOL> test_data ( content = '<STR_LIT>' , args = ( <NUM_LIT:5> , <NUM_LIT:1> ) , expected = <NUM_LIT:3> , msg = '<STR_LIT>' ) , <EOL> test_data ( content = '<STR_LIT>' , args = ( <NUM_LIT:7> , <NUM_LIT:1> ) , expected = <NUM_LIT:4> , msg = '<STR_LIT>' ) , <EOL> ) <EOL> class Test_word_reverse ( ViewTest ) : <EOL> def testAll ( self ) : <EOL> for ( i , data ) in enumerate ( TESTS ) : <EOL> self . write ( data . content ) <EOL> actual = word_reverse ( self . view , * data . args ) <EOL> msg = "<STR_LIT>" . format ( i , data . msg ) <EOL> self . assertEqual ( data . expected , actual , msg ) </s>
