librsvg source for verification 2026-05-22

This commit is contained in:
2026-05-22 16:45:08 +08:00
commit 75af7ac721
2138 changed files with 161177 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
use predicates::prelude::*;
use predicates::str::StartsWithPredicate;
use super::pdf::PdfPredicate;
use super::png::PngPredicate;
use super::svg::SvgPredicate;
/// Predicates to check that some output ([u8]) is of a certain file type
pub fn is_png() -> PngPredicate {
PngPredicate {}
}
pub fn is_ps() -> StartsWithPredicate {
predicate::str::starts_with("%!PS-Adobe-3.0\n")
}
pub fn is_eps() -> StartsWithPredicate {
predicate::str::starts_with("%!PS-Adobe-3.0 EPSF-3.0\n")
}
pub fn is_pdf() -> PdfPredicate {
PdfPredicate {}
}
pub fn is_svg() -> SvgPredicate {
SvgPredicate {}
}