mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-10-30 04:37:29 -06:00
Merge pull request #3662 from nrq6993-a11y/stream/vc-featD-g8-art-style-filter-cap
G8: Regression test for art style filter cap
This commit is contained in:
@@ -764,6 +764,19 @@ mod tests {
|
||||
assert_eq!(feather.params["radius"].as_f64(), Some(5.0));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn art_styles_ignore_filters_beyond_the_cap() {
|
||||
const UNIT: &[u8] = b"/BasicFilter :\n(Adobe Feather) 1 0 /Filter ,\n1 /Visible ,\n/Dictionary : /NotRecorded ,\n; /Dict ;\n /Part ,\n";
|
||||
let mut data =
|
||||
Vec::from(b"/KnownStyle :\n(Capped) /Name ,\n/ActiveStyle :\n/CompoundFilter :\n(Chain Style Filter) 0 0 /Filter ,\n1 /Visible ,\n");
|
||||
for _ in 0..MAX_FILTERS + 16 {
|
||||
data.extend_from_slice(UNIT);
|
||||
}
|
||||
data.extend_from_slice(b";\n");
|
||||
let style = art_styles(&data).remove("Capped").unwrap_or_default();
|
||||
assert!(style.effects.len() <= MAX_FILTERS);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hostile_dash_offsets_and_width_profiles_are_tamed() {
|
||||
let mut f = Filter::default();
|
||||
|
||||
Reference in New Issue
Block a user