Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion avro/src/schema_equality.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ pub fn set_schemata_equality_comparator(
pub(crate) fn compare_schemata(schema_one: &Schema, schema_two: &Schema) -> bool {
SCHEMATA_COMPARATOR_ONCE
.get_or_init(|| {
debug!("Going to use the default schemata equality comparator: SpecificationEq.",);
debug!("Going to use the default schemata equality comparator: StructFieldEq.",);
Box::new(StructFieldEq {
include_attributes: false,
})
Expand Down
10 changes: 10 additions & 0 deletions avro_derive/tests/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,9 @@ mod test_derive {

#[avro(default = r#""Foo""#)]
myenum: MyEnum,

#[avro(default = "null")]
optional: Option<String>,
}

let schema = r#"
Expand Down Expand Up @@ -1442,6 +1445,11 @@ mod test_derive {
"symbols":["Foo", "Bar", "Baz"]
},
"default":"Foo"
},
{
"name":"optional",
"type": ["null", "string"],
"default": null
}
]
}
Expand Down Expand Up @@ -1471,6 +1479,7 @@ mod test_derive {
),
"c" => assert_eq!(None, field.default),
"myenum" => assert_eq!(Some(json!("Foo")), field.default),
"optional" => assert_eq!(Some(json!(null)), field.default),
_ => panic!("Unexpected field name"),
}
}
Expand All @@ -1490,6 +1499,7 @@ mod test_derive {
.collect(),
array: vec![4, 5, 6],
myenum: MyEnum::Bar,
optional: None,
});
}

Expand Down