Skip to content

Commit

Permalink
Revert changes to resvg test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurenzV committed Dec 7, 2023
1 parent 29c8568 commit 52221b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
14 changes: 2 additions & 12 deletions crates/resvg/tests/integration/main.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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
};
Expand Down
6 changes: 5 additions & 1 deletion crates/usvg/tests/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ fn resave_impl(name: &str, id_prefix: Option<String>) {
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();
Expand Down

0 comments on commit 52221b7

Please sign in to comment.