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

Function test_atom_to_option

atomic-core/src/change/atom.rs:1033–1050  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1031
1032 #[test]
1033 fn test_atom_to_option() {
1034 let atom: Atom<Hash> = Atom::Insertion(Insertion {
1035 predecessors: vec![test_hash_position(0)],
1036 successors: vec![],
1037 flag: EdgeFlags::BLOCK,
1038 start: ChangePosition::new(0),
1039 end: ChangePosition::new(10),
1040 inode: test_hash_position(42),
1041 });
1042
1043 let opt_atom = atom.to_option();
1044 assert!(opt_atom.is_new_vertex());
1045
1046 if let Atom::Insertion(nv) = opt_atom {
1047 assert!(nv.predecessors[0].change.is_some());
1048 assert!(nv.inode.change.is_some());
1049 }
1050 }
1051}

Callers

nothing calls this directly

Calls 3

InsertionClass · 0.85
test_hash_positionFunction · 0.70
to_optionMethod · 0.45

Tested by

no test coverage detected