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

Function test_line_numbers

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

Source from the content-addressed store, hash-verified

1097
1098 #[test]
1099 fn test_line_numbers() {
1100 let mut parser = CppParser::new();
1101 let source = r#"
1102int first() {
1103 return 1;
1104}
1105
1106int second() {
1107 return 2;
1108}
1109"#;
1110 let entities = parser.extract(source, "lines.cpp");
1111 let first = entities.iter().find(|e| e.name == "first").unwrap();
1112 let second = entities.iter().find(|e| e.name == "second").unwrap();
1113 assert!(
1114 first.line < second.line,
1115 "first ({}) should come before second ({})",
1116 first.line,
1117 second.line
1118 );
1119 }
1120
1121 #[test]
1122 fn test_language_cpp() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected