Skip to content

Commit

Permalink
Add test for int | string
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniosarosi committed Dec 27, 2024
1 parent 855893f commit 53c7b71
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions engine/baml-lib/jsonish/src/tests/test_unions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,3 +288,14 @@ test_deserializer!(
]),
"1 cup unsalted butter, room temperature"
);

test_deserializer!(
test_ignore_int_if_string_in_union,
"",
"1 cup unsalted butter, room temperature",
FieldType::Union(vec![
FieldType::Primitive(TypeValue::Int),
FieldType::Primitive(TypeValue::String),
]),
"1 cup unsalted butter, room temperature"
);

0 comments on commit 53c7b71

Please sign in to comment.