Reach 100% branch coverage for CSS parser.

This commit is contained in:
Gordon P. Hemsley 2016-09-10 23:44:56 -04:00 committed by Steve Howell
parent 911634d1d4
commit 87b87621fe
1 changed files with 14 additions and 0 deletions

View File

@ -48,6 +48,20 @@ class ParserTestHappyPath(unittest.TestCase):
declaration = block.declarations[0] declaration = block.declarations[0]
self.assertIn('/* comment here */', declaration.text()) self.assertIn('/* comment here */', declaration.text())
def test_no_semicolon(self):
# type: () -> None
my_css = '''
p { color: red }
'''
res = parse(my_css)
self.assertEqual(res.text(), my_css)
section = cast(CssSection, res.sections[0])
self.assertFalse(section.declaration_block.declarations[0].semicolon)
def test_multi_line_selector(self): def test_multi_line_selector(self):
# type: () -> None # type: () -> None
my_css = ''' my_css = '''