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

Source from the content-addressed store, hash-verified

555
556 #[test]
557 fn test_chain_detects_cycle() {
558 // a → b → a is a corrupt parent chain, not an infinite loop.
559 let err =
560 build_view_chain("a", parents(&[("a", Some("b")), ("b", Some("a"))])).unwrap_err();
561 match err {
562 ChainError::Cycle { view } => assert_eq!(view, "a"),
563 other => panic!("Expected Cycle, got {:?}", other),
564 }
565 }
566
567 #[test]
568 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