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

Function test_line_numbers

atomic-semantic/src/parser.rs:1495–1509  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1493
1494 #[test]
1495 fn test_line_numbers() {
1496 let mut extractor = TypeScriptExtractor::new();
1497 let source = r#"// Line 1
1498// Line 2
1499function foo() { // Line 3
1500 return 1; // Line 4
1501} // Line 5
1502"#;
1503 let entities = extractor.extract(source, "test.ts");
1504
1505 assert_eq!(entities.len(), 1);
1506 assert_eq!(entities[0].name, "foo");
1507 assert_eq!(entities[0].line, 3); // 1-based line number
1508 assert_eq!(entities[0].end_line, 5);
1509 }
1510}

Callers

nothing calls this directly

Calls 1

extractMethod · 0.45

Tested by

no test coverage detected