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

Commit

Permalink
Add test of scan error
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jul 29, 2022
1 parent 2c18321 commit 37bd40a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_error.rs
Expand Up @@ -3,7 +3,7 @@
use indoc::indoc;
use serde::de::{Deserialize, SeqAccess, Visitor};
use serde_derive::{Deserialize, Serialize};
use serde_yaml::Deserializer;
use serde_yaml::{Deserializer, Value};
use std::collections::BTreeMap;
use std::fmt::{self, Debug};

Expand All @@ -15,6 +15,13 @@ where
assert_eq!(expected, result.unwrap_err().to_string());
}

#[test]
fn test_scan_error() {
let yaml = ">\n@";
let expected = "deserializing from YAML containing more than one document is not supported";
test_error::<Value>(yaml, expected);
}

#[test]
fn test_incorrect_type() {
let yaml = indoc! {"
Expand Down

0 comments on commit 37bd40a

Please sign in to comment.