Skip to content

Commit

Permalink
AVRO-3651: Add test to de.rs to illustrate issue with Fixed fields
Browse files Browse the repository at this point in the history
  • Loading branch information
RikHeijdens authored and martin-g committed Jul 17, 2024
1 parent 7d43e42 commit d754177
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions lang/rust/avro/src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1550,4 +1550,18 @@ mod tests {
assert_eq!(raw_bytes.unwrap().0, expected_bytes);
Ok(())
}

fn test_avro_3631_struct_fixed_field() {
#[derive(Debug, Serialize, Deserialize)]
struct TestStructFixedField {
field: [u8; 6],
}

let value = Value::Record(vec![(
"field".to_string(),
Value::Fixed(6, vec![0, 0, 0, 0, 0, 0]),
)]);
let _deserialized: TestStructFixedField = from_value(&value).unwrap();

}
}

0 comments on commit d754177

Please sign in to comment.