@@ -29,9 +29,8 @@ mod passing {
2929 // STDOUT should contain isolated HTML
3030 assert_eq ! (
3131 String :: from_utf8_lossy( & out. stdout) ,
32- "<html><head>\
33- <meta http-equiv=\" Content-Security-Policy\" content=\" default-src 'unsafe-eval' 'unsafe-inline' data:;\" ></meta>\
34- </head><body>Hello, World!</body></html>\n "
32+ r#"<html><head><meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-eval' 'unsafe-inline' data:;"></meta></head><body>Hello, World!</body></html>
33+ "#
3534 ) ;
3635
3736 // Exit code should be 0
@@ -54,10 +53,8 @@ mod passing {
5453 // STDOUT should contain HTML with no CSS
5554 assert_eq ! (
5655 String :: from_utf8_lossy( & out. stdout) ,
57- "<html><head>\
58- <meta http-equiv=\" Content-Security-Policy\" content=\" style-src 'none';\" ></meta>\
59- <style></style>\
60- </head><body>Hello</body></html>\n "
56+ r#"<html><head><meta http-equiv="Content-Security-Policy" content="style-src 'none';"></meta><style></style></head><body>Hello</body></html>
57+ "#
6158 ) ;
6259
6360 // Exit code should be 0
@@ -80,10 +77,8 @@ mod passing {
8077 // STDOUT should contain HTML with no web fonts
8178 assert_eq ! (
8279 String :: from_utf8_lossy( & out. stdout) ,
83- "<html><head>\
84- <meta http-equiv=\" Content-Security-Policy\" content=\" font-src 'none';\" ></meta>\
85- <style></style>\
86- </head><body>Hi</body></html>\n "
80+ r#"<html><head><meta http-equiv="Content-Security-Policy" content="font-src 'none';"></meta><style></style></head><body>Hi</body></html>
81+ "#
8782 ) ;
8883
8984 // Exit code should be 0
@@ -96,7 +91,7 @@ mod passing {
9691 let out = cmd
9792 . arg ( "-M" )
9893 . arg ( "-f" )
99- . arg ( "data:text/html,<iframe src=\ " https://duckduckgo.com\ " ></iframe>Hi" )
94+ . arg ( r# "data:text/html,<iframe src="https://duckduckgo.com"></iframe>Hi"# )
10095 . output ( )
10196 . unwrap ( ) ;
10297
@@ -106,9 +101,8 @@ mod passing {
106101 // STDOUT should contain HTML with no iframes
107102 assert_eq ! (
108103 String :: from_utf8_lossy( & out. stdout) ,
109- "<html><head>\
110- <meta http-equiv=\" Content-Security-Policy\" content=\" frame-src 'none'; child-src 'none';\" ></meta>\
111- </head><body><iframe src=\" \" ></iframe>Hi</body></html>\n "
104+ r#"<html><head><meta http-equiv="Content-Security-Policy" content="frame-src 'none'; child-src 'none';"></meta></head><body><iframe src=""></iframe>Hi</body></html>
105+ "#
112106 ) ;
113107
114108 // Exit code should be 0
@@ -132,15 +126,8 @@ mod passing {
132126 assert_eq ! (
133127 String :: from_utf8_lossy( & out. stdout) ,
134128 format!(
135- "<html>\
136- <head>\
137- <meta http-equiv=\" Content-Security-Policy\" content=\" img-src data:;\" ></meta>\
138- </head>\
139- <body>\
140- <img src=\" {empty_image}\" >\
141- Hi\
142- </body>\
143- </html>\n ",
129+ r#"<html><head><meta http-equiv="Content-Security-Policy" content="img-src data:;"></meta></head><body><img src="{empty_image}">Hi</body></html>
130+ "# ,
144131 empty_image = EMPTY_IMAGE_DATA_URL ,
145132 )
146133 ) ;
@@ -165,12 +152,8 @@ mod passing {
165152 // STDOUT should contain HTML with no JS
166153 assert_eq ! (
167154 String :: from_utf8_lossy( & out. stdout) ,
168- "<html>\
169- <head>\
170- <meta http-equiv=\" Content-Security-Policy\" content=\" script-src 'none';\" ></meta>\
171- <script></script></head>\
172- <body>Hi</body>\
173- </html>\n "
155+ r#"<html><head><meta http-equiv="Content-Security-Policy" content="script-src 'none';"></meta><script></script></head><body>Hi</body></html>
156+ "#
174157 ) ;
175158
176159 // Exit code should be 0
@@ -211,7 +194,7 @@ mod failing {
211194 let mut cmd = Command :: cargo_bin ( env ! ( "CARGO_PKG_NAME" ) ) . unwrap ( ) ;
212195 let out = cmd
213196 . arg ( "-M" )
214- . arg ( "data:text/html,%3Cscript%20src=\ " src/tests/data/basic/local-script.js\ " %3E%3C/script%3E" )
197+ . arg ( r# "data:text/html,%3Cscript%20src="src/tests/data/basic/local-script.js"%3E%3C/script%3E"# )
215198 . output ( )
216199 . unwrap ( ) ;
217200
0 commit comments