()
| 662 | |
| 663 | #[test] |
| 664 | fn write_amp_tracking() { |
| 665 | let mut e = make_engine(); |
| 666 | let n = now(); |
| 667 | |
| 668 | e.register_index(1, "c", "a", 0, false, n); |
| 669 | e.register_index(1, "c", "b", 1, false, n); |
| 670 | |
| 671 | for i in 0..10u32 { |
| 672 | let k = format!("k{i}"); |
| 673 | e.put( |
| 674 | 1, |
| 675 | "c", |
| 676 | k.as_bytes(), |
| 677 | &mp_obj(&[("a", "x"), ("b", "y")]), |
| 678 | 0, |
| 679 | n, |
| 680 | Surrogate::ZERO, |
| 681 | ); |
| 682 | } |
| 683 | |
| 684 | // 10 PUTs, 2 indexes each = write amp ratio of 2.0. |
| 685 | let ratio = e.write_amp_ratio(1, "c"); |
| 686 | assert!((ratio - 2.0).abs() < f64::EPSILON); |
| 687 | } |
| 688 | |
| 689 | #[test] |
| 690 | fn raw_put_timing() { |
nothing calls this directly
no test coverage detected