()
| 407 | |
| 408 | #[test] |
| 409 | fn identical_values_compress_minimally() { |
| 410 | let mut enc = GorillaEncoder::new(); |
| 411 | for i in 0..100 { |
| 412 | enc.encode(1000 + i * 1000, 42.0); |
| 413 | } |
| 414 | let data = enc.finish(); |
| 415 | |
| 416 | assert!( |
| 417 | data.len() < 100, |
| 418 | "identical values should compress well, got {} bytes", |
| 419 | data.len() |
| 420 | ); |
| 421 | |
| 422 | let mut dec = GorillaDecoder::new(&data); |
| 423 | let samples = dec.decode_all(); |
| 424 | assert_eq!(samples.len(), 100); |
| 425 | for s in &samples { |
| 426 | assert!((s.1 - 42.0).abs() < f64::EPSILON); |
| 427 | } |
| 428 | } |
| 429 | |
| 430 | #[test] |
| 431 | fn f64_batch_roundtrip() { |
nothing calls this directly
no test coverage detected