1
use predicates::prelude::*;
2
use predicates::str::StartsWithPredicate;
3

            
4
use super::pdf::PdfPredicate;
5
use super::png::PngPredicate;
6
use super::svg::SvgPredicate;
7

            
8
/// Predicates to check that some output ([u8]) is of a certain file type
9

            
10
42
pub fn is_png() -> PngPredicate {
11
    PngPredicate {}
12
42
}
13

            
14
2
pub fn is_ps() -> StartsWithPredicate {
15
2
    predicate::str::starts_with("%!PS-Adobe-3.0\n")
16
2
}
17

            
18
2
pub fn is_eps() -> StartsWithPredicate {
19
2
    predicate::str::starts_with("%!PS-Adobe-3.0 EPSF-3.0\n")
20
2
}
21

            
22
27
pub fn is_pdf() -> PdfPredicate {
23
    PdfPredicate {}
24
27
}
25

            
26
4
pub fn is_svg() -> SvgPredicate {
27
    SvgPredicate {}
28
4
}