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

Function test_entity_builder

atomic-semantic/src/entity.rs:377–389  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

375
376 #[test]
377 fn test_entity_builder() {
378 let entity = Entity::new("authenticate", EntityKind::Function, "src/auth.ts", 10, 25)
379 .with_column(0)
380 .with_signature("async function authenticate(creds: Credentials): Promise<Token>")
381 .with_exported(true);
382
383 assert_eq!(entity.name, "authenticate");
384 assert_eq!(entity.kind, EntityKind::Function);
385 assert_eq!(entity.line, 10);
386 assert_eq!(entity.end_line, 25);
387 assert!(entity.exported);
388 assert!(entity.signature.is_some());
389 }
390
391 #[test]
392 fn test_entity_serialization() {

Callers

nothing calls this directly

Calls 3

with_exportedMethod · 0.80
with_columnMethod · 0.80
with_signatureMethod · 0.45

Tested by

no test coverage detected