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

Function one_line_entry

atomic-core/src/record/workflow/assembly/tests.rs:322–336  ·  view source on GitHub ↗

One one-line file-create entry with a single leaf: the smallest possible placeholder namespace span (branch span 1, leaf span 1).

(path: &str)

Source from the content-addressed store, hash-verified

320/// One one-line file-create entry with a single leaf: the smallest possible
321/// placeholder namespace span (branch span 1, leaf span 1).
322fn one_line_entry(path: &str) -> FileOps {
323 let mut ops = FileOps::create(CrdtTrunkId::ROOT, path.to_string(), None);
324 ops.add_line_op(crate::change::LineOps::new(
325 CrdtBranchId::ROOT,
326 BranchOp::Insert {
327 after: None,
328 content: vec![LeafOp::Insert {
329 after: None,
330 kind: TokenKind::Word,
331 content: b"line".to_vec(),
332 }],
333 },
334 ));
335 ops
336}
337
338/// A multi-line entry: `lines` chained inserts plus `tokens` leaves per line,
339/// with `after` references that must shift with the branch base.

Calls 2

createFunction · 0.50
add_line_opMethod · 0.45

Tested by

no test coverage detected