Ejemplo n.º 1
0
    def test_that_enumeration_type_declarations_are_found(self):
        code = """\
type incomplete_type_declaration_t;
 type   color_t  is( blue ,red  , green ) ;  -- Color type
type animal_t is (cow);"""

        enums = {e.identifier: e.literals for e in VHDLEnumerationType.find(code)}
        expect = {'color_t': ['blue', 'red', 'green'], 'animal_t': ['cow']}
        self.assertEqual(enums, expect)
Ejemplo n.º 2
0
    def test_that_enumeration_type_declarations_are_found(self):
        code = """\
type incomplete_type_declaration_t;
 type   color_t  is( blue ,red  , green ) ;  -- Color type
type animal_t is (cow);"""

        enums = {e.identifier: e.literals for e in VHDLEnumerationType.find(code)}
        expect = {"color_t": ["blue", "red", "green"], "animal_t": ["cow"]}
        self.assertEqual(enums, expect)
Ejemplo n.º 3
0
    def test_that_enumeration_type_declarations_are_found(self):
        code = """\
type incomplete_type_declaration_t;
 type   color_t  is( blue ,red  , green ) ;  -- Color type
type animal_t is (cow);"""

        enums = {e.identifier: e.literals for e in VHDLEnumerationType.find(code)}
        expect = {'color_t': ['blue', 'red', 'green'], 'animal_t': ['cow']}
        self.assertEqual(enums, expect)
Ejemplo n.º 4
0
    def test_that_enumeration_type_declarations_are_found(self):
        code = """\
type incomplete_type_declaration_t;
 type   color_t  is( blue ,red  , green ) ;  -- Color type
type animal_t is (cow);"""

        enums = {e.identifier: e.literals for e in VHDLEnumerationType.find(code)}
        expect = {"color_t": ["blue", "red", "green"], "animal_t": ["cow"]}
        self.assertEqual(enums, expect)