sim_lib_discrete_graph/
cards.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
9pub struct CardSpec {
10 pub key: &'static str,
12 pub summary: &'static str,
14 pub operations: &'static [&'static str],
16 pub data_forms: &'static [&'static str],
18 pub limits: &'static str,
20}
21
22pub fn graph_cards() -> &'static [CardSpec] {
24 const CARDS: &[CardSpec] = &[CardSpec {
25 key: "discrete/graph",
26 summary: "Weighted graphs with traversal and connectivity.",
27 operations: &[
28 "bfs",
29 "dfs",
30 "connected-components",
31 "weakly-connected-components",
32 "strongly-connected-components",
33 ],
34 data_forms: &["graph", "edge"],
35 limits: "Node identity is index-based; multiedges and self-loops are \
36 representable. Connectivity validates endpoints and fails closed \
37 on out-of-range nodes.",
38 }];
39 CARDS
40}
41
42#[cfg(test)]
43mod tests {
44 use super::*;
45
46 #[test]
47 fn graph_card_is_present_and_ascii() {
48 let cards = graph_cards();
49 assert_eq!(cards.len(), 1);
50 assert_eq!(cards[0].key, "discrete/graph");
51 assert!(cards[0].summary.is_ascii());
52 }
53}