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

Function test_line_numbers

atomic-semantic/src/parsers/python.rs:655–672  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

653
654 #[test]
655 fn test_line_numbers() {
656 let mut parser = PythonParser::new();
657 let source = r#"
658def first():
659 pass
660
661def second():
662 pass
663"#;
664 let entities = parser.extract(source, "lines.py");
665 let first = entities.iter().find(|e| e.name == "first").unwrap();
666 let second = entities.iter().find(|e| e.name == "second").unwrap();
667 assert!(first.line < second.line, "first should be before second");
668 assert!(
669 first.end_line < second.line,
670 "first should end before second starts"
671 );
672 }
673
674 #[test]
675 fn test_multiple_entities() {

Callers

nothing calls this directly

Calls 3

extractMethod · 0.45
unwrapMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected