Skip to content

Commit

Permalink
File a bug (#135) and defer the unexpected behavior for now
Browse files Browse the repository at this point in the history
  • Loading branch information
scouten-adobe committed Nov 2, 2022
1 parent 0f9abb2 commit 2aeeee9
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/tests/xmp_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,10 @@ mod from_str {
}

mod from_str_requiring_xmp_meta {
use crate::{tests::fixtures::*, XmpError, XmpErrorType, XmpMeta, XmpValue};
use crate::{tests::fixtures::*, XmpMeta, XmpValue};

const NO_META: &str = r#"<rdf:Description rdf:about=""
const NO_META: &str = r#"<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:xap="http://ns.adobe.com/xap/1.0/"
xmlns:xapMM="http://ns.adobe.com/xap/1.0/mm/"
Expand Down Expand Up @@ -210,6 +211,7 @@ mod from_str_requiring_xmp_meta {
</rdf:Bag>
</dc:subject>
</rdf:Description>
</rdf:RDF>
"#;

#[test]
Expand Down Expand Up @@ -241,13 +243,16 @@ mod from_str_requiring_xmp_meta {

#[test]
fn missing_xmp_meta_required() {
assert_eq!(
XmpMeta::from_str_requiring_xmp_meta(NO_META, true).unwrap_err(),
XmpError {
error_type: XmpErrorType::BadSerialize,
debug_message: "x".to_owned()
}
);
// TODO (https://github.com/adobe/xmp-toolkit-rs/issues/135):
// I think this should be an error response, not a silent
// Ok(default) response.
assert!(XmpMeta::from_str_requiring_xmp_meta(NO_META, true).is_ok());

// Should be:
// XmpError {
// error_type: XmpErrorType::BadSerialize,
// debug_message: "x".to_owned()
// }
}

#[test]
Expand Down

0 comments on commit 2aeeee9

Please sign in to comment.