コード例 #1
0
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 ) ) )
コード例 #2
0
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 ) ) )
コード例 #3
0
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 ) ) )
コード例 #4
0
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)))
コード例 #5
0
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)))
コード例 #6
0
    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))))
コード例 #7
0
def PreviousIdentifier_IdentOnPreviousLine_JunkAfterIdent_test():
  assert_that( 'foo', equal_to(
    ic._PreviousIdentifier( 2,
                            False,
                            BuildRequestWrap( 'foo **;()\n   ',
                            column_num = 3,
                            line_num = 2 ) ) ) )
コード例 #8
0
 def test_PreviousIdentifier_NoGoodIdentFound(self):
     assert_that(
         '',
         equal_to(
             ic._PreviousIdentifier(
                 5, False,
                 BuildRequestWrap('foo\n ', column_num=2, line_num=2))))
コード例 #9
0
 def test_PreviousIdentifier_JunkAfterIdent(self):
     assert_that(
         'foo',
         equal_to(
             ic._PreviousIdentifier(2, False,
                                    BuildRequestWrap('foo  ;;()**   ',
                                                     13))))
コード例 #10
0
 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))))
コード例 #11
0
def PreviousIdentifier_WholeIdentShouldBeBeforeColumn_test():
  eq_( '',
       ic._PreviousIdentifier( 2, BuildRequestWrap( 'foobar',
                                                    column_num = 4 ) ) )
コード例 #12
0
def PreviousIdentifier_DoNotWrap_test():
  eq_( '',
       ic._PreviousIdentifier( 2, BuildRequestWrap( 'foobar\n bar',
                                                    column_num = 4 ) ) )
コード例 #13
0
 def test_PreviousIdentifier_IgnoreForwardIdents(self):
     assert_that(
         'foo',
         equal_to(
             ic._PreviousIdentifier(2, False,
                                    BuildRequestWrap('foo bar zoo', 4))))
コード例 #14
0
def PreviousIdentifier_IgnoreTooSmallIdent_test():
  eq_( '', ic._PreviousIdentifier( 4, BuildRequestWrap( 'foo', 4 ) ) )
コード例 #15
0
def PreviousIdentifier_ColumnInMiddleStillWholeIdent_test():
  eq_( 'foobar', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foobar', 4 ) ) )
コード例 #16
0
def PreviousIdentifier_IdentOnPreviousLine_JunkAfterIdent_test():
  eq_( 'foo',
       ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo **;()\n   ',
                                                    column_num = 3,
                                                    line_num = 2 ) ) )
コード例 #17
0
def PreviousIdentifier_IdentInMiddleOfJunk_test():
  eq_( 'aa',
       ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo  ;;(aa)**   ', 13 ) ) )
コード例 #18
0
 def test_PreviousIdentifier_WholeIdentShouldBeBeforeColumn(self):
     assert_that(
         '',
         equal_to(
             ic._PreviousIdentifier(
                 2, False, BuildRequestWrap('foobar', column_num=4))))
コード例 #19
0
 def test_PreviousIdentifier_IdentInMiddleOfJunk(self):
     assert_that(
         'aa',
         equal_to(
             ic._PreviousIdentifier(
                 2, False, BuildRequestWrap('foo  ;;(aa)**   ', 13))))
コード例 #20
0
 def test_PreviousIdentifier_WhitespaceAfterIdent(self):
     assert_that(
         'foo',
         equal_to(
             ic._PreviousIdentifier(2, False,
                                    BuildRequestWrap('foo     ', 6))))
コード例 #21
0
 def test_PreviousIdentifier_IgnoreTooSmallIdent_DontContinueLooking(self):
     assert_that(
         '',
         equal_to(
             ic._PreviousIdentifier(4, False,
                                    BuildRequestWrap('abcde foo', 10))))
コード例 #22
0
 def test_PreviousIdentifier_IgnoreTooSmallIdent(self):
     assert_that(
         '',
         equal_to(
             ic._PreviousIdentifier(4, False, BuildRequestWrap('foo', 4))))
コード例 #23
0
def PreviousIdentifier_WhitespaceAfterIdent_test():
  eq_( 'foo', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo     ', 6 ) ) )
コード例 #24
0
def PreviousIdentifier_JunkAfterIdent_test():
  eq_( 'foo',
       ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo  ;;()**   ', 13 ) ) )
コード例 #25
0
 def test_PreviousIdentifier_Simple(self):
     assert_that(
         'foo',
         equal_to(
             ic._PreviousIdentifier(2, False, BuildRequestWrap('foo', 4))))
コード例 #26
0
def PreviousIdentifier_NoGoodIdentFound_test():
  eq_( '',
       ic._PreviousIdentifier( 5, BuildRequestWrap( 'foo\n ',
                                                    column_num = 2,
                                                    line_num = 2 ) ) )
コード例 #27
0
def PreviousIdentifier_WholeIdentShouldBeBeforeColumn_test():
    eq_(
        '',
        ic._PreviousIdentifier(2, False,
                               BuildRequestWrap('foobar', column_num=4)))
コード例 #28
0
def PreviousIdentifier_Simple_test():
  eq_( 'foo', ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo', 4 ) ) )
コード例 #29
0
def PreviousIdentifier_DoNotWrap_test():
    eq_(
        '',
        ic._PreviousIdentifier(2, False,
                               BuildRequestWrap('foobar\n bar', column_num=4)))
コード例 #30
0
def PreviousIdentifier_IgnoreForwardIdents_test():
  eq_( 'foo',
       ic._PreviousIdentifier( 2, BuildRequestWrap( 'foo bar zoo', 4 ) ) )
コード例 #31
0
def PreviousIdentifier_NoGoodIdentFound_test():
    eq_(
        '',
        ic._PreviousIdentifier(
            5, False, BuildRequestWrap('foo\n ', column_num=2, line_num=2)))
コード例 #32
0
def PreviousIdentifier_IgnoreTooSmallIdent_DontContinueLooking_test():
  eq_( '', ic._PreviousIdentifier( 4, BuildRequestWrap( 'abcde foo', 10 ) ) )
コード例 #33
0
 def test_PreviousIdentifier_DoNotWrap(self):
     assert_that(
         '',
         equal_to(
             ic._PreviousIdentifier(
                 2, False, BuildRequestWrap('foobar\n bar', column_num=4))))