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

Function mixin_dependency

src/toposort.rs:320–336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

318
319 #[test]
320 fn mixin_dependency() {
321 let builder = make_class("Builder");
322 let mut model = make_class("Model");
323 model.mixins = vec![crate::atom::atom("Builder")];
324
325 let classes = vec![
326 ("Model".to_string(), &model),
327 ("Builder".to_string(), &builder),
328 ];
329
330 let sorted = toposort_classes(classes.into_iter());
331
332 let pos_b = sorted.iter().position(|s| s == "Builder").unwrap();
333 let pos_m = sorted.iter().position(|s| s == "Model").unwrap();
334
335 assert!(pos_b < pos_m, "Builder must come before Model");
336 }
337
338 #[test]
339 fn cycle_does_not_panic() {

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