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

Function test_line_numbers

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

Source from the content-addressed store, hash-verified

1465
1466 #[test]
1467 fn test_line_numbers() {
1468 let mut extractor = TypeScriptExtractor::new();
1469 let source = r#"// Line 1
1470// Line 2
1471function foo() { // Line 3
1472 return 1; // Line 4
1473} // Line 5
1474"#;
1475 let entities = extractor.extract(source, "test.ts");
1476
1477 assert_eq!(entities.len(), 1);
1478 assert_eq!(entities[0].name, "foo");
1479 assert_eq!(entities[0].line, 3); // 1-based line number
1480 assert_eq!(entities[0].end_line, 5);
1481 }
1482}

Callers

nothing calls this directly

Calls 1

extractMethod · 0.45

Tested by

no test coverage detected