def test_fix_rule_008(self):
        oRule = whitespace.rule_008()

        oRule.fix(self.oFile)

        lActual = self.oFile.get_lines()

        self.assertEqual(lExpected, lActual)

        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, [])
    def test_008(self):
        oRule = whitespace.rule_008()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'whitespace')
        self.assertEqual(oRule.identifier, '008')
        self.assertEqual(oRule.phase, 2)

        dExpected = [1, 3]
        self.oFile.lines.append(line.line('  std_logic_vector (7 downto 0)'))
        self.oFile.lines.append(line.line('  std_logic_vector(7 downto 0)'))
        self.oFile.lines.append(line.line('  std_logic_vector   (7 downto 0)'))
        oRule.analyze(self.oFile)
        self.assertEqual(oRule.violations, dExpected)
    def test_rule_008(self):
        oRule = whitespace.rule_008()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'whitespace')
        self.assertEqual(oRule.identifier, '008')

        lExpected = [21, 28]

        oRule.analyze(self.oFile)
        self.assertEqual(
            lExpected,
            utils.extract_violation_lines_from_violation_object(
                oRule.violations))
    def test_fix_008(self):
        oRule = whitespace.rule_008()
        self.assertTrue(oRule)
        self.assertEqual(oRule.name, 'whitespace')
        self.assertEqual(oRule.identifier, '008')

        oFile = vhdlFile.vhdlFile(sFileName)

        dExpected = []
        oFile.lines.append(line.line('A  std_logic_vector (7 downto 0)'))
        oFile.lines.append(line.line('  std_logic_vector(7 downto 0)'))
        oFile.lines.append(line.line('  std_logic_vector   (7 downto 0)'))
        oRule.fix(oFile)
        oRule.analyze(oFile)
        self.assertEqual(oRule.violations, dExpected)
        self.assertEqual(oFile.lines[1].line, 'A  std_logic_vector(7 downto 0)')
        self.assertEqual(oFile.lines[2].line, '  std_logic_vector(7 downto 0)')
        self.assertEqual(oFile.lines[3].line, '  std_logic_vector(7 downto 0)')