From 52221b7fa004556e301fbe71ab83cc11f96b91a1 Mon Sep 17 00:00:00 2001 From: Laurenz Stampfl <47084093+LaurenzV@users.noreply.github.com> Date: Thu, 7 Dec 2023 19:51:39 +0100 Subject: [PATCH] Revert changes to resvg test suite --- crates/resvg/tests/integration/main.rs | 14 ++------------ crates/usvg/tests/write.rs | 6 +++++- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/crates/resvg/tests/integration/main.rs b/crates/resvg/tests/integration/main.rs index 8dcf40363..9cc73acdd 100644 --- a/crates/resvg/tests/integration/main.rs +++ b/crates/resvg/tests/integration/main.rs @@ -1,6 +1,6 @@ use once_cell::sync::Lazy; use rgb::{FromSlice, RGBA8}; -use usvg::{fontdb, TreeParsing, TreeTextToPath, TreeWriting, XmlOptions}; +use usvg::{fontdb, TreeParsing, TreeTextToPath}; #[rustfmt::skip] mod render; @@ -34,18 +34,8 @@ pub fn render(name: &str) -> usize { let tree = { let svg_data = std::fs::read(&svg_path).unwrap(); - // TODO: Revert this + let mut tree = usvg::Tree::from_data(&svg_data, &opt).unwrap(); let db = GLOBAL_FONTDB.lock().unwrap(); - let mut original_tree = usvg::Tree::from_data(&svg_data, &opt) - .unwrap(); - original_tree.convert_text(&db); - - let mut tree = usvg::Tree::from_str( - &original_tree - .to_string(&XmlOptions::default()), - &opt, - ) - .unwrap(); tree.convert_text(&db); tree }; diff --git a/crates/usvg/tests/write.rs b/crates/usvg/tests/write.rs index 6b7a22bd4..fb2de0e62 100644 --- a/crates/usvg/tests/write.rs +++ b/crates/usvg/tests/write.rs @@ -43,7 +43,11 @@ fn resave_impl(name: &str, id_prefix: Option) { xml_opt.transforms_precision = 4; let output_svg = tree.to_string(&xml_opt); - std::fs::write(format!("tests/files/{}-expected.svg", name), output_svg.clone()).unwrap(); + std::fs::write( + format!("tests/files/{}-expected.svg", name), + output_svg.clone(), + ) + .unwrap(); let expected_svg = std::fs::read_to_string(format!("tests/files/{}-expected.svg", name)).unwrap();