()
| 373 | |
| 374 | #[test] |
| 375 | fn flush_partial_batch() { |
| 376 | let mut c = TriggerBatchCollector::new(10); |
| 377 | c.push("orders", "INSERT", 1, row("1")); |
| 378 | c.push("orders", "INSERT", 1, row("2")); |
| 379 | let batch = c.flush(); |
| 380 | assert!(batch.is_some()); |
| 381 | assert_eq!(batch.unwrap().rows.len(), 2); |
| 382 | assert!(!c.has_pending()); |
| 383 | } |
| 384 | |
| 385 | #[test] |
| 386 | fn different_collection_flushes_old() { |