MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_extract_method_out_of_line

Function test_extract_method_out_of_line

atomic-semantic/src/parsers/cpp.rs:982–1011  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

980
981 #[test]
982 fn test_extract_method_out_of_line() {
983 let mut parser = CppParser::new();
984 let source = r#"
985class Server {
986public:
987 void start();
988 int port();
989};
990
991void Server::start() {
992 running = true;
993}
994
995int Server::port() {
996 return port_;
997}
998"#;
999 let entities = parser.extract(source, "server.cpp");
1000
1001 let start = entities.iter().find(|e| e.name == "Server::start").unwrap();
1002 assert_eq!(start.kind, EntityKind::Method);
1003 assert!(
1004 start.signature.as_ref().unwrap().contains("Server::start"),
1005 "Signature: {:?}",
1006 start.signature
1007 );
1008
1009 let port = entities.iter().find(|e| e.name == "Server::port").unwrap();
1010 assert_eq!(port.kind, EntityKind::Method);
1011 }
1012
1013 #[test]
1014 fn test_extract_inline_method() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected