@@ -34,17 +34,22 @@ fn test_renders_local_images() {
34
34
let mut file = NamedTempFile :: new ( ) . unwrap ( ) ;
35
35
let tempdir = file. path ( ) . parent ( ) . unwrap ( ) . to_path_buf ( ) ;
36
36
37
- writeln ! ( file, "" ) . unwrap ( ) ;
38
- writeln ! ( file, "" ) . unwrap ( ) ;
39
- writeln ! ( file, "" ) . unwrap ( ) ;
37
+ writeln ! ( file, "" ) . unwrap ( ) ;
38
+ writeln ! ( file, "" ) . unwrap ( ) ;
39
+ writeln ! ( file, "" ) . unwrap ( ) ;
40
+ writeln ! ( file, "" ) . unwrap ( ) ;
41
+ writeln ! ( file, "" ) . unwrap ( ) ;
42
+ writeln ! ( file, "" ) . unwrap ( ) ;
43
+ writeln ! ( file, "" ) . unwrap ( ) ;
40
44
41
45
let renderer = Renderer :: new ( file. path ( ) . to_path_buf ( ) ) ;
42
46
let content = renderer. run ( ) . unwrap ( ) ;
43
47
44
- let local_src = format ! ( "src=\" file://{}/local-image.png\" " , tempdir. display( ) ) ;
45
- assert ! ( content. html. contains( & local_src) ) ;
46
- assert ! ( content. html. contains( "src=\" http://remote-image.png\" " ) ) ;
47
-
48
- // Without a ./ prefix, it's left alone
49
- assert ! ( content. html. contains( "src=\" unprefixed_image.png\" " ) ) ;
48
+ assert ! ( content. html. contains( & format!( "src=\" file://{}/local-image-01.png\" " , tempdir. display( ) ) ) ) ;
49
+ assert ! ( content. html. contains( & format!( "src=\" file://{}/.local-image-02.png\" " , tempdir. display( ) ) ) ) ;
50
+ assert ! ( content. html. contains( & format!( "src=\" file://{}/local-image-03.png\" " , tempdir. display( ) ) ) ) ;
51
+ assert ! ( content. html. contains( & format!( "src=\" file://{}/local-image-04.png\" " , tempdir. display( ) ) ) ) ;
52
+ assert ! ( content. html. contains( & format!( "src=\" file://{}/../local-image-05.png\" " , tempdir. display( ) ) ) ) ;
53
+ assert ! ( content. html. contains( "src=\" http://remote-image-01.png\" " ) ) ;
54
+ assert ! ( content. html. contains( "src=\" https://remote-image-02.png\" " ) ) ;
50
55
}
0 commit comments