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

Function wants_roundtrip_and_all_helper

atomic-objects/src/sync.rs:378–395  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

376
377 #[test]
378 fn wants_roundtrip_and_all_helper() {
379 let wants = SyncWants::all(vec!["aa".to_string(), "bb".to_string()]);
380 assert!(wants.wants_all());
381 let bytes = wants.encode().expect("encode");
382 assert_eq!(SyncWants::decode(&bytes).expect("decode"), wants);
383
384 let scoped = SyncWants {
385 refs: vec!["dev".to_string()],
386 haves: vec![],
387 refs_only: false,
388 };
389 assert!(!scoped.wants_all());
390
391 let adv = SyncWants::advertise(vec!["dev".to_string()]);
392 assert!(adv.refs_only);
393 assert!(!adv.wants_all());
394 assert_eq!(SyncWants::decode(&adv.encode().unwrap()).unwrap(), adv);
395 }
396
397 #[test]
398 fn empty_pack_is_empty() {

Callers

nothing calls this directly

Calls 1

encodeMethod · 0.45

Tested by

no test coverage detected