Skip to content

Commit

Permalink
Add some coercion + null examples
Browse files Browse the repository at this point in the history
  • Loading branch information
chmp committed Aug 9, 2024
1 parent 91a5465 commit 7746873
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions serde_arrow/src/test/schema_tracing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,30 @@ mod untagged_enum_number_coercion {
test!(f64_u16, "F64", false, [(Num::F64(0.0),), (Num::U16(0),)]);
test!(f64_u32, "F64", false, [(Num::F64(0.0),), (Num::U32(0),)]);
test!(f64_u64, "F64", false, [(Num::F64(0.0),), (Num::U64(0),)]);

// some coercion + null examples
test!(
f64_u8_null,
"F64",
true,
[(Num::F64(0.0),), (Num::U8(0),), (Num::Null(()),)]
);
test!(
i32_i64_null,
"I64",
true,
[(Num::I32(0),), (Num::I64(0),), (Num::Null(()),)]
);
test!(
f32_f64_null,
"F64",
true,
[(Num::F32(0.0),), (Num::F64(0.0),), (Num::Null(()),)]
);
test!(
u8_u16_null,
"U64",
true,
[(Num::U8(0),), (Num::U16(0),), (Num::Null(()),)]
);
}

0 comments on commit 7746873

Please sign in to comment.