def PreviousIdentifier_IdentOnPreviousLine_test(): eq_( 'foo', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo\n ', column_num = 3, line_num = 2 ) ) ) eq_( 'foo', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo\n', column_num = 1, line_num = 2 ) ) )
def PreviousIdentifier_CollectIdentifierFromCommentsAndStrings_test(): eq_( 'foo', ic._PreviousIdentifier( 2, True, BuildRequestWrap( '"foo"\n', column_num = 1, line_num = 2 ) ) ) eq_( 'foo', ic._PreviousIdentifier( 2, True, BuildRequestWrap( '/*\n' ' * foo\n' ' */', column_num = 2, line_num = 3 ) ) )
def PreviousIdentifier_IgnoreIdentifierFromCommentsAndStrings_test(): eq_( '', ic._PreviousIdentifier( 2, False, BuildRequestWrap( '"foo"\n', column_num = 1, line_num = 2 ) ) ) eq_( '', ic._PreviousIdentifier( 2, False, BuildRequestWrap( '/*\n' ' * foo\n' ' */', column_num = 2, line_num = 3 ) ) )
def PreviousIdentifier_IgnoreIdentifierFromCommentsAndStrings_test(): eq_( '', ic._PreviousIdentifier( 2, False, BuildRequestWrap('"foo"\n', column_num=1, line_num=2))) eq_( '', ic._PreviousIdentifier( 2, False, BuildRequestWrap('/*\n' ' * foo\n' ' */', column_num=2, line_num=3)))
def PreviousIdentifier_CollectIdentifierFromCommentsAndStrings_test(): eq_( 'foo', ic._PreviousIdentifier( 2, True, BuildRequestWrap('"foo"\n', column_num=1, line_num=2))) eq_( 'foo', ic._PreviousIdentifier( 2, True, BuildRequestWrap('/*\n' ' * foo\n' ' */', column_num=2, line_num=3)))
def test_PreviousIdentifier_IdentOnPreviousLine(self): assert_that( 'foo', equal_to( ic._PreviousIdentifier( 2, False, BuildRequestWrap('foo\n ', column_num=3, line_num=2)))) assert_that( 'foo', equal_to( ic._PreviousIdentifier( 2, False, BuildRequestWrap('foo\n', column_num=1, line_num=2))))
def PreviousIdentifier_IdentOnPreviousLine_JunkAfterIdent_test(): assert_that( 'foo', equal_to( ic._PreviousIdentifier( 2, False, BuildRequestWrap( 'foo **;()\n ', column_num = 3, line_num = 2 ) ) ) )
def test_PreviousIdentifier_NoGoodIdentFound(self): assert_that( '', equal_to( ic._PreviousIdentifier( 5, False, BuildRequestWrap('foo\n ', column_num=2, line_num=2))))
def test_PreviousIdentifier_JunkAfterIdent(self): assert_that( 'foo', equal_to( ic._PreviousIdentifier(2, False, BuildRequestWrap('foo ;;()** ', 13))))
def test_PreviousIdentifier_CollectIdentifierFromCommentsAndStrings(self): assert_that( 'foo', equal_to( ic._PreviousIdentifier( 2, True, BuildRequestWrap('"foo"\n', column_num=1, line_num=2)))) assert_that( 'foo', equal_to( ic._PreviousIdentifier( 2, True, BuildRequestWrap('/*\n' ' * foo\n' ' */', column_num=2, line_num=3))))
def PreviousIdentifier_WholeIdentShouldBeBeforeColumn_test(): eq_( '', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foobar', column_num = 4 ) ) )
def PreviousIdentifier_DoNotWrap_test(): eq_( '', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foobar\n bar', column_num = 4 ) ) )
def test_PreviousIdentifier_IgnoreForwardIdents(self): assert_that( 'foo', equal_to( ic._PreviousIdentifier(2, False, BuildRequestWrap('foo bar zoo', 4))))
def PreviousIdentifier_IgnoreTooSmallIdent_test(): eq_( '', ic._PreviousIdentifier( 4, BuildRequestWrap( 'foo', 4 ) ) )
def PreviousIdentifier_ColumnInMiddleStillWholeIdent_test(): eq_( 'foobar', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foobar', 4 ) ) )
def PreviousIdentifier_IdentOnPreviousLine_JunkAfterIdent_test(): eq_( 'foo', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo **;()\n ', column_num = 3, line_num = 2 ) ) )
def PreviousIdentifier_IdentInMiddleOfJunk_test(): eq_( 'aa', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo ;;(aa)** ', 13 ) ) )
def test_PreviousIdentifier_WholeIdentShouldBeBeforeColumn(self): assert_that( '', equal_to( ic._PreviousIdentifier( 2, False, BuildRequestWrap('foobar', column_num=4))))
def test_PreviousIdentifier_IdentInMiddleOfJunk(self): assert_that( 'aa', equal_to( ic._PreviousIdentifier( 2, False, BuildRequestWrap('foo ;;(aa)** ', 13))))
def test_PreviousIdentifier_WhitespaceAfterIdent(self): assert_that( 'foo', equal_to( ic._PreviousIdentifier(2, False, BuildRequestWrap('foo ', 6))))
def test_PreviousIdentifier_IgnoreTooSmallIdent_DontContinueLooking(self): assert_that( '', equal_to( ic._PreviousIdentifier(4, False, BuildRequestWrap('abcde foo', 10))))
def test_PreviousIdentifier_IgnoreTooSmallIdent(self): assert_that( '', equal_to( ic._PreviousIdentifier(4, False, BuildRequestWrap('foo', 4))))
def PreviousIdentifier_WhitespaceAfterIdent_test(): eq_( 'foo', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo ', 6 ) ) )
def PreviousIdentifier_JunkAfterIdent_test(): eq_( 'foo', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo ;;()** ', 13 ) ) )
def test_PreviousIdentifier_Simple(self): assert_that( 'foo', equal_to( ic._PreviousIdentifier(2, False, BuildRequestWrap('foo', 4))))
def PreviousIdentifier_NoGoodIdentFound_test(): eq_( '', ic._PreviousIdentifier( 5, BuildRequestWrap( 'foo\n ', column_num = 2, line_num = 2 ) ) )
def PreviousIdentifier_WholeIdentShouldBeBeforeColumn_test(): eq_( '', ic._PreviousIdentifier(2, False, BuildRequestWrap('foobar', column_num=4)))
def PreviousIdentifier_Simple_test(): eq_( 'foo', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo', 4 ) ) )
def PreviousIdentifier_DoNotWrap_test(): eq_( '', ic._PreviousIdentifier(2, False, BuildRequestWrap('foobar\n bar', column_num=4)))
def PreviousIdentifier_IgnoreForwardIdents_test(): eq_( 'foo', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo bar zoo', 4 ) ) )
def PreviousIdentifier_NoGoodIdentFound_test(): eq_( '', ic._PreviousIdentifier( 5, False, BuildRequestWrap('foo\n ', column_num=2, line_num=2)))
def PreviousIdentifier_IgnoreTooSmallIdent_DontContinueLooking_test(): eq_( '', ic._PreviousIdentifier( 4, BuildRequestWrap( 'abcde foo', 10 ) ) )
def test_PreviousIdentifier_DoNotWrap(self): assert_that( '', equal_to( ic._PreviousIdentifier( 2, False, BuildRequestWrap('foobar\n bar', column_num=4))))