jklamer commented on code in PR #1636:
URL: https://github.com/apache/avro/pull/1636#discussion_r846702626
##########
lang/rust/avro/src/types.rs:
##########
@@ -878,15 +979,65 @@ mod tests {
false,
),
(Value::Record(vec![]), Schema::Null, false),
+ (
+ Value::Fixed(12, vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]),
+ Schema::Duration,
+ true,
+ ),
+ (
+ Value::Fixed(11, vec![0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
+ Schema::Duration,
+ false,
+ ),
+ (
+ Value::Record(vec![("unknown_field_name".to_string(),
Value::Null)]),
+ Schema::Record {
+ name: Name::new("record_name").unwrap(),
+ aliases: None,
+ doc: None,
+ fields: vec![RecordField {
+ name: "field_name".to_string(),
+ doc: None,
+ default: None,
+ schema: Schema::Int,
+ order: RecordFieldOrder::Ignore,
+ position: 0,
+ }],
+ lookup: Default::default(),
+ },
+ false,
+ ),
+ (
+ Value::Record(vec![("field_name".to_string(), Value::Null)]),
+ Schema::Record {
+ name: Name::new("record_name").unwrap(),
+ aliases: None,
+ doc: None,
+ fields: vec![RecordField {
+ name: "field_name".to_string(),
+ doc: None,
+ default: None,
+ schema: Schema::Ref {
+ name: Name::new("missing").unwrap(),
+ },
+ order: RecordFieldOrder::Ignore,
+ position: 0,
+ }],
+ lookup: Default::default(),
+ },
+ false,
+ ),
];
for (value, schema, valid) in value_schema_valid.into_iter() {
- assert_eq!(valid, value.validate(&schema));
+ assert_eq!(valid, value.validate_internal(&schema,
&HashMap::default()));
}
}
#[test]
fn validate_fixed() {
+ init();
Review Comment:
Is there an assertion that the validation is logging for these tests? Do we
need to keep them logging for other builds?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]