Пример #1
0
def ExtractKeywordsFromGroup_KeywordMiddle_test():
    eq_(['foo', 'bar', 'zoo', 'goo'],
        syntax_parse._ExtractKeywordsFromGroup(
            syntax_parse.SyntaxGroup('', [
                'foo oneline bar',
                'zoo goo',
            ])))
Пример #2
0
def ExtractKeywordsFromGroup_KeywordAssign_test():
    eq_(['foo', 'bar', 'zoo', 'goo'],
        syntax_parse._ExtractKeywordsFromGroup(
            syntax_parse.SyntaxGroup('', [
                'foo end=zoo((^^//)) bar',
                'zoo goo',
            ])))
Пример #3
0
def ExtractKeywordsFromGroup_KeywordWithoutNextgroup_test():
    assert_that(
        syntax_parse._ExtractKeywordsFromGroup(
            syntax_parse.SyntaxGroup('', [
                'skipempty foo bar',
                'zoo goo',
            ])), contains_inanyorder('skipempty', 'foo', 'bar', 'zoo', 'goo'))
Пример #4
0
def ExtractKeywordsFromGroup_Commas_test():
    eq_(['foo', 'bar', 'zoo', 'goo'],
        syntax_parse._ExtractKeywordsFromGroup(
            syntax_parse.SyntaxGroup('', [
                'foo, bar,',
                'zoo goo',
            ])))
Пример #5
0
def ExtractKeywordsFromGroup_KeywordAssignAndMiddle_test():
    assert_that(
        syntax_parse._ExtractKeywordsFromGroup(
            syntax_parse.SyntaxGroup('', [
                'nextgroup=zoo foo skipnl bar',
                'zoo goo',
            ])), contains_inanyorder('foo', 'skipnl', 'bar', 'zoo', 'goo'))
Пример #6
0
def ExtractKeywordsFromGroup_Commas_test():
    assert_that(
        syntax_parse._ExtractKeywordsFromGroup(
            syntax_parse.SyntaxGroup('', [
                'foo, bar,',
                'zoo goo',
            ])), contains_inanyorder('foo', 'bar', 'zoo', 'goo'))
Пример #7
0
def ExtractKeywordsFromGroup_ContainedSyntaxArgAllowed_test():
  eq_( ['foo', 'zoq', 'bar', 'goo', 'far' ],
       syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
         'contained foo zoq',
         'contained bar goo',
         'far',
       ] ) ) )
Пример #8
0
def ExtractKeywordsFromGroup_KeywordStarts_test():
  eq_( ['foo', 'bar', 'zoo', 'goo' ],
       syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
         'foo bar',
         'transparent boo baa',
         'zoo goo',
       ] ) ) )
Пример #9
0
def ExtractKeywordsFromGroup_WithLinksTo_test():
  eq_( ['foo', 'bar', 'zoo', 'goo' ],
       syntax_parse._ExtractKeywordsFromGroup( syntax_parse.SyntaxGroup('', [
         'foo bar',
         'zoo goo',
         'links to Statement'
       ] ) ) )
Пример #10
0
def ExtractKeywordsFromGroup_KeywordStarts_test():
    assert_that(
        syntax_parse._ExtractKeywordsFromGroup(
            syntax_parse.SyntaxGroup('', [
                'foo bar',
                'contained boo baa',
                'zoo goo',
            ])), contains_inanyorder('foo', 'bar', 'boo', 'baa', 'zoo', 'goo'))
Пример #11
0
def ExtractKeywordsFromGroup_ContainedSyntaxArgAllowed_test():
  assert_that( syntax_parse._ExtractKeywordsFromGroup(
                 syntax_parse.SyntaxGroup( '', [
                   'contained foo zoq',
                   'contained bar goo',
                   'far'
                 ] ) ),
               contains_inanyorder( 'foo', 'zoq', 'bar', 'goo', 'far' ) )
Пример #12
0
def ExtractKeywordsFromGroup_WithLinksTo_test():
  assert_that( syntax_parse._ExtractKeywordsFromGroup(
                 syntax_parse.SyntaxGroup( '', [
                   'foo bar',
                   'zoo goo',
                   'links to Statement'
                 ] ) ),
               contains_inanyorder( 'foo', 'bar', 'zoo', 'goo' ) )
Пример #13
0
def ExtractKeywordsFromGroup_KeywordMiddle_test():
    assert_that(
        syntax_parse._ExtractKeywordsFromGroup(
            syntax_parse.SyntaxGroup('', ['foo contained bar', 'zoo goo'])),
        contains_inanyorder('foo', 'contained', 'bar', 'zoo', 'goo'))