<s> import unittest <EOL> from vex . parsers . g_cmd import GlobalLexer <EOL> class TestGlobalLexer ( unittest . TestCase ) : <EOL> def setUp ( self ) : <EOL> self . lexer = GlobalLexer ( ) <EOL> def testCanMatchFullPattern ( self ) : <EOL> actual = self . lexer . parse ( r'<STR_LIT>' ) <EOL> self . assertEqual ( actual , [ '<STR_LIT:foo>' , '<STR_LIT>' ] ) <EOL> def testCanMatchEmtpySearch ( self ) : <EOL> actual = self . lexer . parse ( r'<STR_LIT>' ) <EOL> self . assertEqual ( actual , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def testCanEscapeCharactersInSearchPattern ( self ) : <EOL> actual = self . lexer . parse ( r'<STR_LIT>' ) <EOL> self . assertEqual ( actual , [ '<STR_LIT>' , '<STR_LIT>' ] ) <EOL> def testCanEscapeBackSlashes ( self ) : <EOL> actual = self . lexer . parse ( r'<STR_LIT>' ) <EOL> self . assertEqual ( actual , [ '<STR_LIT:\\>' , '<STR_LIT>' ] ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
