diff --git a/vsg/tests/assert_statement/assert_test_input.vhd b/vsg/tests/assert_statement/assert_test_input.vhd index 8ada625b..0a548035 100644 --- a/vsg/tests/assert_statement/assert_test_input.vhd +++ b/vsg/tests/assert_statement/assert_test_input.vhd @@ -20,4 +20,13 @@ begin report "Something" severity FAILURE; + PROC : process (CLK) is + begin + + assert 3 <= 7 + report "something"; + + end process PROC; + + end architecture ARCH; diff --git a/vsg/tests/vhdlFile/test_vhdlFile_assert.py b/vsg/tests/vhdlFile/test_vhdlFile_assert.py index f6af71f5..ab7552b3 100644 --- a/vsg/tests/vhdlFile/test_vhdlFile_assert.py +++ b/vsg/tests/vhdlFile/test_vhdlFile_assert.py @@ -10,7 +10,7 @@ oFile = vhdlFile.vhdlFile(lFile) class testVhdlFileMethods(unittest.TestCase): def test_isAssertKeyword_assignment(self): - lExpected = [6,10,15,19] + lExpected = [6,10,15,19,26] # Generic actual list lActual = [] for iIndex, oLine in enumerate(oFile.lines): @@ -20,7 +20,7 @@ class testVhdlFileMethods(unittest.TestCase): self.assertEqual(lActual, lExpected) def test_isAssertEnd_assignment(self): - lExpected = [8,12,17,21] + lExpected = [8,12,17,21,27] # Generic actual list lActual = [] for iIndex, oLine in enumerate(oFile.lines): @@ -30,7 +30,7 @@ class testVhdlFileMethods(unittest.TestCase): self.assertEqual(lActual, lExpected) def test_insideAssert_assignment(self): - lExpected = [6,7,8,10,11,12,15,16,17,19,20,21] + lExpected = [6,7,8,10,11,12,15,16,17,19,20,21,26,27] # Generic actual list lActual = [] for iIndex, oLine in enumerate(oFile.lines): @@ -38,3 +38,20 @@ class testVhdlFileMethods(unittest.TestCase): lActual.append(iIndex) # Compare self.assertEqual(lActual, lExpected) + + def test_indent(self): + lExpected = [None,1,1,None,2,3,None,1,None] + lActual = [] + for iIndex, oLine in enumerate(oFile.lines): + if iIndex > 21 and iIndex < 31: + lActual.append(oLine.indentLevel) + self.assertEqual(lActual, lExpected) + + def test_sequential(self): + lExpected = [] + lActual = [] + for iIndex, oLine in enumerate(oFile.lines): + if oLine.insideSequential: + lActual.append(iIndex) + # Compare + self.assertEqual(lActual, lExpected) diff --git a/vsg/vhdlFile/classify/sequential.py b/vsg/vhdlFile/classify/sequential.py index e5588983..db5727e7 100644 --- a/vsg/vhdlFile/classify/sequential.py +++ b/vsg/vhdlFile/classify/sequential.py @@ -5,7 +5,7 @@ def sequential(dVars, oLine): if not (oLine.insideProcess or oLine.insideProcedure): return - if re.match('^.*<=', oLine.line) and not oLine.isComment and not oLine.insideIf and not oLine.isElseKeyword and not oLine.insideCaseWhen: + if re.match('^.*<=', oLine.line) and not oLine.isComment and not oLine.insideIf and not oLine.isElseKeyword and not oLine.insideCaseWhen and not oLine.insideAssert: oLine.isSequential = True oLine.insideSequential = True oLine.indentLevel = dVars['iCurrentIndentLevel']