Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Commit

Permalink
Update test_error to test same errors in multi-document mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Apr 5, 2023
1 parent 48fc779 commit 69b5272
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/test_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ where
{
let result = serde_yaml::from_str::<T>(yaml);
assert_eq!(expected, result.unwrap_err().to_string());

let mut deserializer = Deserializer::from_str(yaml);
if let Some(first_document) = deserializer.next() {
if deserializer.next().is_none() {
let result = T::deserialize(first_document);
assert_eq!(expected, result.unwrap_err().to_string());
}
}
}

#[test]
Expand Down

0 comments on commit 69b5272

Please sign in to comment.