@@ -8,14 +8,10 @@ use tempfile::{Builder, NamedTempFile};
88
99pub fn fixture_path ( name : & str ) -> PathBuf {
1010 PathBuf :: from ( env ! ( "CARGO_MANIFEST_DIR" ) )
11- . join ( "../../test/data " )
11+ . join ( "../../fixtures " )
1212 . join ( name)
1313}
1414
15- pub fn rust_png_fixture_path ( name : & str ) -> PathBuf {
16- fixture_path ( "rust" ) . join ( name)
17- }
18-
1915pub fn read_fixture ( name : & str ) -> Vec < u8 > {
2016 fs:: read ( fixture_path ( name) ) . expect ( "fixture bytes" )
2117}
@@ -29,7 +25,7 @@ pub fn named_temp_file(suffix: &str) -> NamedTempFile {
2925
3026pub fn assert_png_file_matches_fixture ( actual : impl AsRef < Path > , fixture : & str ) {
3127 let actual = image:: open ( actual) . expect ( "open actual png" ) . into_rgba8 ( ) ;
32- let expected = image:: open ( rust_png_fixture_path ( fixture) )
28+ let expected = image:: open ( fixture_path ( fixture) )
3329 . expect ( "open expected png" )
3430 . into_rgba8 ( ) ;
3531 assert_png_eq ( & actual, & expected, fixture) ;
@@ -39,7 +35,7 @@ pub fn assert_png_bytes_match_fixture(actual: &[u8], fixture: &str) {
3935 let actual = load_from_memory ( actual)
4036 . expect ( "decode actual png" )
4137 . into_rgba8 ( ) ;
42- let expected = image:: open ( rust_png_fixture_path ( fixture) )
38+ let expected = image:: open ( fixture_path ( fixture) )
4339 . expect ( "open expected png" )
4440 . into_rgba8 ( ) ;
4541 assert_png_eq ( & actual, & expected, fixture) ;
0 commit comments