MCPcopy Create free account
hub / github.com/douchuan/algorithm / symbol_graph

Function symbol_graph

tests/test_undirected_graph.rs:145–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143
144#[test]
145fn symbol_graph() {
146 let i = ROUTES;
147 let symbol = SymbolGraph::new(i, " ", |nv| Box::new(Graph::from(nv)));
148 let graph = symbol.G();
149 let mut expect = vec!["ORD", "ATL", "MCO"];
150 expect.sort();
151 let mut adj = vec![];
152 let u = symbol.index("JFK").unwrap();
153 for &w in graph.adj(u) {
154 adj.push(symbol.name(w).unwrap());
155 }
156 adj.sort();
157 assert_eq!(expect, adj);
158}
159
160#[test]
161fn degree_of_separation() {

Callers

nothing calls this directly

Calls 6

GMethod · 0.80
indexMethod · 0.80
pushMethod · 0.80
nameMethod · 0.80
sortMethod · 0.45
adjMethod · 0.45

Tested by

no test coverage detected