| 142 | |
| 143 | #[test] |
| 144 | fn put_then_flush_emits_segment() { |
| 145 | let dir = TempDir::new().unwrap(); |
| 146 | let mut e = ArrayEngine::new(ArrayEngineConfig::new(dir.path().to_path_buf())).unwrap(); |
| 147 | e.open_array(aid(), schema(), 0xCAFE).unwrap(); |
| 148 | put_one(&mut e, 1, 2, 10, 1); |
| 149 | let seg = e.flush(&aid(), 7).unwrap().expect("non-empty flush"); |
| 150 | assert_eq!(seg.level, 0); |
| 151 | assert_eq!(seg.tile_count, 1); |
| 152 | assert_eq!(seg.flush_lsn, 7); |
| 153 | assert!(e.store(&aid()).unwrap().manifest().segments.len() == 1); |
| 154 | } |
| 155 | |
| 156 | #[test] |
| 157 | fn flush_no_op_when_memtable_empty() { |