Skip to content

Commit

Permalink
Add tests for WordPerfect formats
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalecot committed Jul 14, 2023
1 parent 287b5d4 commit 287fd6d
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
Binary file added fixtures/document/sample.wpm
Binary file not shown.
Binary file added fixtures/document/sample1.wpd
Binary file not shown.
Binary file added fixtures/document/sample1.wpg
Binary file not shown.
Binary file added fixtures/document/sample2.wpd
Binary file not shown.
Binary file added fixtures/document/sample2.wpg
Binary file not shown.
32 changes: 32 additions & 0 deletions tests/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -336,3 +336,35 @@ fn test_sun_xml_writer_template() {
let fmt = FileFormat::from_file("fixtures/document/sample.stw").unwrap();
assert_eq!(fmt, FileFormat::SunXmlWriterTemplate);
}

#[test]
fn test_wordperfect_document_1() {
let fmt = FileFormat::from_file("fixtures/document/sample1.wpd").unwrap();
assert_eq!(fmt, FileFormat::WordperfectDocument);
}

#[cfg(feature = "reader-cfb")]
#[test]
fn test_wordperfect_document_2() {
let fmt = FileFormat::from_file("fixtures/document/sample2.wpd").unwrap();
assert_eq!(fmt, FileFormat::WordperfectDocument);
}

#[test]
fn test_wordperfect_graphics_1() {
let fmt = FileFormat::from_file("fixtures/document/sample1.wpg").unwrap();
assert_eq!(fmt, FileFormat::WordperfectGraphics);
}

#[cfg(feature = "reader-cfb")]
#[test]
fn test_wordperfect_graphics_2() {
let fmt = FileFormat::from_file("fixtures/document/sample2.wpg").unwrap();
assert_eq!(fmt, FileFormat::WordperfectGraphics);
}

#[test]
fn test_wordperfect_macro() {
let fmt = FileFormat::from_file("fixtures/document/sample.wpm").unwrap();
assert_eq!(fmt, FileFormat::WordperfectMacro);
}

0 comments on commit 287fd6d

Please sign in to comment.