def testCanScanDollar(self): scanner = Scanner(";") tokens = list(scanner.scan()) self.assertEqual([TokenSemicolon(), TokenEof()], tokens)
def test_CanSetMultipleTimesSemicolonLast(self): parsed = parse_command_line("1;2,3;4") self.assertEqual(parsed.line_range.separator, TokenSemicolon())
def test_CanSetSemicolon(self): parsed = parse_command_line(";") self.assertEqual(parsed.line_range.separator, TokenSemicolon())
def test_CanParseSemicolonOffset(self): parsed = parse_command_line('+10;+10') self.assertEqual(parsed.line_range.start, [TokenOffset([10])]) self.assertEqual(parsed.line_range.end, [TokenOffset([10])]) self.assertEqual(parsed.line_range.separator, TokenSemicolon())
def test_CanParseSmicolonDot(self): parsed = parse_command_line(';.') self.assertEqual(parsed.line_range.start, []) self.assertEqual(parsed.line_range.end, [TokenDot()]) self.assertEqual(parsed.line_range.separator, TokenSemicolon())
def test_CanParseLoneSmicolon(self): parsed = parse_command_line(';') self.assertEqual(parsed.line_range.separator, TokenSemicolon())