Constellation, Spacedust, Slingshot, UFOs: atproto crates and services for microcosm
0

Configure Feed

Select the types of activity you want to include in your feed.

more non-create commit overflowing/maxing tests

+32 -14
+32 -14
ufos/src/lib.rs
··· 323 323 fn test_truncating_insert_maxes_out_deletes() -> anyhow::Result<()> { 324 324 let mut commits: CollectionCommits<2> = Default::default(); 325 325 326 - commits.truncating_insert(UFOsCommit { 327 - cursor: Cursor::from_raw_u64(100), 328 - did: Did::new("did:plc:whatever".to_string()).unwrap(), 329 - rkey: RecordKey::new("rkey-asdf-a".to_string()).unwrap(), 330 - rev: "rev-asdf".to_string(), 331 - action: CommitAction::Cut, 332 - }).unwrap(); 326 + commits 327 + .truncating_insert(UFOsCommit { 328 + cursor: Cursor::from_raw_u64(100), 329 + did: Did::new("did:plc:whatever".to_string()).unwrap(), 330 + rkey: RecordKey::new("rkey-asdf-a".to_string()).unwrap(), 331 + rev: "rev-asdf".to_string(), 332 + action: CommitAction::Cut, 333 + }) 334 + .unwrap(); 333 335 334 - commits.truncating_insert(UFOsCommit { 335 - cursor: Cursor::from_raw_u64(101), 336 - did: Did::new("did:plc:whatever".to_string()).unwrap(), 337 - rkey: RecordKey::new("rkey-asdf-b".to_string()).unwrap(), 338 - rev: "rev-asdg".to_string(), 339 - action: CommitAction::Cut, 340 - }).unwrap(); 336 + // this create will just be discarded 337 + commits 338 + .truncating_insert(UFOsCommit { 339 + cursor: Cursor::from_raw_u64(80), 340 + did: Did::new("did:plc:whatever".to_string()).unwrap(), 341 + rkey: RecordKey::new("rkey-asdf-zzz".to_string()).unwrap(), 342 + rev: "rev-asdzzz".to_string(), 343 + action: CommitAction::Put(PutAction { 344 + record: RawValue::from_string("{}".to_string())?, 345 + is_update: false, 346 + }), 347 + }) 348 + .unwrap(); 349 + 350 + commits 351 + .truncating_insert(UFOsCommit { 352 + cursor: Cursor::from_raw_u64(101), 353 + did: Did::new("did:plc:whatever".to_string()).unwrap(), 354 + rkey: RecordKey::new("rkey-asdf-b".to_string()).unwrap(), 355 + rev: "rev-asdg".to_string(), 356 + action: CommitAction::Cut, 357 + }) 358 + .unwrap(); 341 359 342 360 let res = commits.truncating_insert(UFOsCommit { 343 361 cursor: Cursor::from_raw_u64(102),