'Tests that the tags of structs/unions/enums reside in a separate namespace and
can be named after existing types.'

def test_tags_namespace(self):

    s1 = '\n                                                                typedef    int    tagEntry;\n\n                                                                struct    tagEntry\n                                                                {\n                                                                                char*    key;\n                                                                                char*    value;\n                                                                }    Entry;\n                                                '
    s1_ast = self.parse(s1)
    self.assertEqual(expand_decl(s1_ast.ext[1]), ['Decl', 'Entry', ['TypeDecl', ['Struct', 'tagEntry', [['Decl', 'key', ['PtrDecl', ['TypeDecl', ['IdentifierType', ['char']]]]], ['Decl', 'value', ['PtrDecl', ['TypeDecl', ['IdentifierType', ['char']]]]]]]]])
    s2 = '\n                                                                struct    tagEntry;\n\n                                                                typedef    struct    tagEntry    tagEntry;\n\n                                                                struct    tagEntry\n                                                                {\n                                                                                char*    key;\n                                                                                char*    value;\n                                                                }    Entry;\n                                                '
    s2_ast = self.parse(s2)
    self.assertEqual(expand_decl(s2_ast.ext[2]), ['Decl', 'Entry', ['TypeDecl', ['Struct', 'tagEntry', [['Decl', 'key', ['PtrDecl', ['TypeDecl', ['IdentifierType', ['char']]]]], ['Decl', 'value', ['PtrDecl', ['TypeDecl', ['IdentifierType', ['char']]]]]]]]])
    s3 = '\n                                                                typedef    int    mytag;\n\n                                                                enum    mytag    {ABC,    CDE};\n                                                                enum    mytag    joe;\n                                                '
    s3_type = self.parse(s3).ext[1].type
    self.assertTrue(isinstance(s3_type, Enum))
    self.assertEqual(s3_type.name, 'mytag')
