MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / copy_ranges

Function copy_ranges

crates/commitlog/tests/streaming/mod.rs:54–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53#[tokio::test]
54async fn copy_ranges() {
55 enable_logging();
56
57 let root = tempdir().unwrap();
58 let (src, dst) = create_dirs(root.path()).await;
59 fill_log(src.clone()).await;
60
61 let mut writer = create_writer(dst.clone())
62 .await
63 .expect("failed to create stream writer");
64
65 for (start, end) in [(0, 25), (25, 50), (50, 75), (75, 101)] {
66 info!("appending range {start}..{end}");
67 let reader = create_reader(&src, start..end);
68 pin!(reader);
69 writer = writer.append_all(reader, |_| ()).await.unwrap();
70 }
71 writer.sync_all().await.unwrap();
72
73 assert_equal_dirs(&src, &dst).await
74}
75
76#[tokio::test]
77async fn copy_invalid_range() {

Callers

nothing calls this directly

Calls 11

create_dirsFunction · 0.85
create_writerFunction · 0.85
create_readerFunction · 0.85
assert_equal_dirsFunction · 0.85
append_allMethod · 0.80
fill_logFunction · 0.70
enable_loggingFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
cloneMethod · 0.45
sync_allMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…