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

Function fixture

atomic-core/src/change/format_v3/semantic/tests.rs:20–110  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18}
19
20pub(super) fn fixture() -> Vec<FileOps> {
21 let trunk = TrunkId::new(NodeId::new(u64::MAX), u32::MAX);
22 let b = |o, i| BranchId::new(NodeId::new(o), i);
23 let l = |o, i| LeafId::new(NodeId::new(o), i);
24 let leaves = vec![
25 token(None, b""),
26 token(Some(LeafId::ROOT), b"\xff\0"),
27 token(Some(l(u64::MAX, u32::MAX)), "é\r\n".as_bytes()),
28 LeafOp::Delete { leaf: l(19, 8) },
29 LeafOp::Replace {
30 leaf: l(6, 2),
31 new_content: b"absent old text".to_vec(),
32 },
33 LeafOp::Restore { leaf: l(0, 92) },
34 ];
35 let lines = [
36 BranchOp::Insert {
37 after: None,
38 content: leaves.clone(),
39 },
40 BranchOp::Insert {
41 after: Some(BranchId::ROOT),
42 content: vec![],
43 },
44 BranchOp::Delete {
45 branch: b(9, 4),
46 content: leaves.clone(),
47 },
48 BranchOp::Modify {
49 branch: b(3, 8),
50 old_content: leaves,
51 new_content: vec![token(None, b"new\n")],
52 },
53 BranchOp::Restore { branch: b(8, 1) },
54 BranchOp::Reparent {
55 branch: b(9, 8),
56 new_after: Some(b(3, 9)),
57 },
58 BranchOp::Reparent {
59 branch: b(9, 8),
60 new_after: None,
61 },
62 ];
63 vec![
64 None,
65 Some(TrunkOp::Create {
66 path: "α".into(),
67 encoding: Some(Encoding::Utf8),
68 }),
69 Some(TrunkOp::Create {
70 path: "binary".into(),
71 encoding: None,
72 }),
73 Some(TrunkOp::Delete { trunk }),
74 Some(TrunkOp::Move {
75 trunk,
76 new_path: "renamed".into(),
77 }),

Calls 6

cloneMethod · 0.45
collectMethod · 0.45
into_iterMethod · 0.45
iterMethod · 0.45
set_content_rangeMethod · 0.45
add_line_opMethod · 0.45

Tested by

no test coverage detected