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

Function test_line_numbers

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

Source from the content-addressed store, hash-verified

1420
1421 #[test]
1422 fn test_line_numbers() {
1423 let mut extractor = TypeScriptExtractor::new();
1424 let source = r#"// Line 1
1425// Line 2
1426function foo() { // Line 3
1427 return 1; // Line 4
1428} // Line 5
1429"#;
1430 let entities = extractor.extract(source, "test.ts");
1431
1432 assert_eq!(entities.len(), 1);
1433 assert_eq!(entities[0].name, "foo");
1434 assert_eq!(entities[0].line, 3); // 1-based line number
1435 assert_eq!(entities[0].end_line, 5);
1436 }
1437}

Callers

nothing calls this directly

Calls 1

extractMethod · 0.45

Tested by

no test coverage detected