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

Function test_line_numbers

atomic-semantic/src/parsers/java.rs:1014–1032  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1012
1013 #[test]
1014 fn test_line_numbers() {
1015 let mut parser = JavaParser::new();
1016 let source = r#"
1017public class Lines {
1018 public void first() {}
1019
1020 public void second() {}
1021}
1022"#;
1023 let entities = parser.extract(source, "Lines.java");
1024 let first = entities.iter().find(|e| e.name == "first").unwrap();
1025 let second = entities.iter().find(|e| e.name == "second").unwrap();
1026 assert!(
1027 first.line < second.line,
1028 "first ({}) should come before second ({})",
1029 first.line,
1030 second.line
1031 );
1032 }
1033
1034 #[test]
1035 fn test_language() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected