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

Function test_chain_detects_cycle

atomic-cli/src/commands/push/helpers.rs:611–619  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

609
610 #[test]
611 fn test_chain_detects_cycle() {
612 // a → b → a is a corrupt parent chain, not an infinite loop.
613 let err =
614 build_view_chain("a", parents(&[("a", Some("b")), ("b", Some("a"))])).unwrap_err();
615 match err {
616 ChainError::Cycle { view } => assert_eq!(view, "a"),
617 other => panic!("Expected Cycle, got {:?}", other),
618 }
619 }
620
621 #[test]
622 fn test_chain_detects_self_cycle() {

Callers

nothing calls this directly

Calls 2

build_view_chainFunction · 0.85
parentsFunction · 0.85

Tested by

no test coverage detected