E.g., when implementing YAML support, this testcase fails because more content is expected after goodbye:, so it points at column 9... in an 8-column line.
I feel like it'd still be useful to show that information.
#[test]
#[cfg(feature = "yaml-serde")]
fn yaml_invalid() {
use axoasset::AxoassetError;
#[derive(serde::Deserialize, PartialEq, Eq, Debug)]
struct MyType {
hello: String,
goodbye: bool,
}
// Make the file
let contents = String::from(
r##"
hello: "there"
goodbye:
"##,
);
let source = axoasset::SourceFile::new("file.yml", contents);
let res = source.deserialize_yaml::<MyType>();
assert!(res.is_err());
println!("{:#?}", res);
let Err(AxoassetError::Yaml { span: Some(_), .. }) = res else {
panic!("span was invalid");
};
}
E.g., when implementing YAML support, this testcase fails because more content is expected after
goodbye:, so it points at column 9... in an 8-column line.I feel like it'd still be useful to show that information.