MCPcopy Create free account
hub / github.com/PHPantom-dev/phpantom_lsp / trait_dependency

Function trait_dependency

src/toposort.rs:285–298  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283
284 #[test]
285 fn trait_dependency() {
286 let t = make_class("MyTrait");
287 let mut c = make_class("MyClass");
288 c.used_traits = vec![crate::atom::atom("MyTrait")];
289
290 let classes = vec![("MyClass".to_string(), &c), ("MyTrait".to_string(), &t)];
291
292 let sorted = toposort_classes(classes.into_iter());
293
294 let pos_t = sorted.iter().position(|s| s == "MyTrait").unwrap();
295 let pos_c = sorted.iter().position(|s| s == "MyClass").unwrap();
296
297 assert!(pos_t < pos_c, "MyTrait must come before MyClass");
298 }
299
300 #[test]
301 fn interface_dependency() {

Callers

nothing calls this directly

Calls 5

toposort_classesFunction · 0.85
into_iterMethod · 0.80
iterMethod · 0.80
make_classFunction · 0.70
unwrapMethod · 0.45

Tested by

no test coverage detected