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:568–576  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

566
567 #[test]
568 fn test_chain_detects_cycle() {
569 // a → b → a is a corrupt parent chain, not an infinite loop.
570 let err =
571 build_view_chain("a", parents(&[("a", Some("b")), ("b", Some("a"))])).unwrap_err();
572 match err {
573 ChainError::Cycle { view } => assert_eq!(view, "a"),
574 other => panic!("Expected Cycle, got {:?}", other),
575 }
576 }
577
578 #[test]
579 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