()
| 258 | for (number, hex_encoding) in binary_encodings().iter() { |
| 259 | let encoded = GenericDatumWriter::builder(&Schema::Long) |
| 260 | .build()? |
| 261 | .write_value_to_vec(Value::Long(*number))?; |
| 262 | assert_eq!(&encoded, hex_encoding); |
| 263 | } |
| 264 | |
| 265 | Ok(()) |
| 266 | } |
| 267 | |
| 268 | #[test] |
| 269 | fn test_schema_promotion() -> TestResult { |
| 270 | // Each schema is present in order of promotion (int -> long, long -> float, float -> double) |
| 271 | // Each value represents the expected decoded value when promoting a value previously encoded with a promotable schema |
| 272 | let promotable_schemas = [r#""int""#, r#""long""#, r#""float""#, r#""double""#]; |
nothing calls this directly
no test coverage detected