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

Function copy_invalid_range

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

Source from the content-addressed store, hash-verified

75
76#[tokio::test]
77async fn copy_invalid_range() {
78 enable_logging();
79
80 let root = tempdir().unwrap();
81 let (src, dst) = create_dirs(root.path()).await;
82 fill_log(src.clone()).await;
83
84 let mut writer = create_writer(dst.clone()).await.expect("failed to create writer");
85
86 {
87 info!("appending `..50`");
88 let reader = create_reader(&src, ..50);
89 pin!(reader);
90 writer = writer.append_all(reader, |_| ()).await.unwrap();
91 writer.sync_all().await.unwrap();
92 }
93 {
94 info!("appending `75..`");
95 let reader = create_reader(&src, 75..);
96 pin!(reader);
97 pretty_assertions::assert_matches!(
98 writer.append_all(reader, |_| ()).await.map(drop),
99 Err(e) if e.kind() == io::ErrorKind::InvalidData
100 );
101 }
102}
103
104#[tokio::test]
105async fn trim_garbage() {

Callers

nothing calls this directly

Calls 10

create_dirsFunction · 0.85
create_writerFunction · 0.85
create_readerFunction · 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…