MCPcopy Create free account
hub / github.com/CodeGraphContext/CodeGraphContext / test_enum_parsing

Function test_enum_parsing

tests/unit/parsers/test_cpp_enums.py:22–34  ·  view source on GitHub ↗
(cpp_parser, temp_test_dir)

Source from the content-addressed store, hash-verified

20
21
22def test_enum_parsing(cpp_parser, temp_test_dir):
23 code = """
24enum Color { RED, GREEN, BLUE };
25
26enum class Status { OK = 0, ERROR = 1 };
27"""
28 f = temp_test_dir / "enums.cpp"
29 f.write_text(code)
30 result = cpp_parser.parse(f)
31
32 enum_names = [e["name"] for e in result.get("enums", [])]
33 assert "Color" in enum_names
34 assert "Status" in enum_names
35
36
37def test_file_with_enums_and_classes(cpp_parser, temp_test_dir):

Callers

nothing calls this directly

Calls 2

getMethod · 0.65
parseMethod · 0.45

Tested by

no test coverage detected