This page should have black background and white foreground, but only when served via http: (not via file:)
+
+
+
+
+
+
+"##
)
);
diff --git a/tests/cli/noscript.rs b/tests/cli/noscript.rs
index 902895cb..1e3a6c08 100644
--- a/tests/cli/noscript.rs
+++ b/tests/cli/noscript.rs
@@ -131,14 +131,9 @@ mod passing {
// STDOUT should contain HTML with no CSS
assert_eq!(
String::from_utf8_lossy(&out.stdout),
- "\
- \
- \
- \
- \
- \n\
- \
- \n"
+ r#"
+
+"#
);
// Exit code should be 0
diff --git a/tests/cookies/parse_cookie_file_contents.rs b/tests/cookies/parse_cookie_file_contents.rs
index e7067d37..58217f7c 100644
--- a/tests/cookies/parse_cookie_file_contents.rs
+++ b/tests/cookies/parse_cookie_file_contents.rs
@@ -11,8 +11,8 @@ mod passing {
#[test]
fn parse_file() {
- let file_contents =
- "# Netscape HTTP Cookie File\n127.0.0.1\tFALSE\t/\tFALSE\t0\tUSER_TOKEN\tin";
+ let file_contents = r#"# Netscape HTTP Cookie File
+127.0.0.1 FALSE / FALSE 0 USER_TOKEN in"#;
let result = cookies::parse_cookie_file_contents(file_contents).unwrap();
assert_eq!(result.len(), 1);
assert_eq!(result[0].domain, "127.0.0.1");
@@ -26,7 +26,11 @@ mod passing {
#[test]
fn parse_multiline_file() {
- let file_contents = "# HTTP Cookie File\n127.0.0.1\tFALSE\t/\tFALSE\t0\tUSER_TOKEN\tin\n127.0.0.1\tTRUE\t/\tTRUE\t9\tUSER_TOKEN\tout\n\n";
+ let file_contents = r#"# HTTP Cookie File
+127.0.0.1 FALSE / FALSE 0 USER_TOKEN in
+127.0.0.1 TRUE / TRUE 9 USER_TOKEN out
+
+"#;
let result = cookies::parse_cookie_file_contents(file_contents).unwrap();
assert_eq!(result.len(), 2);
assert_eq!(result[0].domain, "127.0.0.1");
@@ -66,7 +70,7 @@ mod failing {
#[test]
fn no_header() {
- let file_contents = "127.0.0.1 FALSE / FALSE 0 USER_TOKEN in";
+ let file_contents = "127.0.0.1 FALSE / FALSE 0 USER_TOKEN in";
match cookies::parse_cookie_file_contents(file_contents) {
Ok(_result) => {
assert!(false);
diff --git a/tests/core/retrieve_asset.rs b/tests/core/retrieve_asset.rs
index 4381bdbd..c962a2ac 100644
--- a/tests/core/retrieve_asset.rs
+++ b/tests/core/retrieve_asset.rs
@@ -77,7 +77,11 @@ mod passing {
.unwrap();
assert_eq!(&media_type, "text/javascript");
assert_eq!(&charset, "");
- assert_eq!(url::create_data_url(&media_type, &charset, &data, &final_url), Url::parse("data:text/javascript;base64,ZG9jdW1lbnQuYm9keS5zdHlsZS5iYWNrZ3JvdW5kQ29sb3IgPSAiZ3JlZW4iOwpkb2N1bWVudC5ib2R5LnN0eWxlLmNvbG9yID0gInJlZCI7Cg==").unwrap());
+ let data_url = "data:text/javascript;base64,ZG9jdW1lbnQuYm9keS5zdHlsZS5iYWNrZ3JvdW5kQ29sb3IgPSAiZ3JlZW4iOwpkb2N1bWVudC5ib2R5LnN0eWxlLmNvbG9yID0gInJlZCI7Cg==";
+ assert_eq!(
+ url::create_data_url(&media_type, &charset, &data, &final_url),
+ Url::parse(data_url).unwrap()
+ );
assert_eq!(
final_url,
Url::parse(&format!(
diff --git a/tests/html/has_favicon.rs b/tests/html/has_favicon.rs
index 96f3d602..6601123f 100644
--- a/tests/html/has_favicon.rs
+++ b/tests/html/has_favicon.rs
@@ -11,7 +11,7 @@ mod passing {
#[test]
fn icon() {
- let html = "
text
";
+ let html = r#"
text
"#;
let dom = html::html_to_dom(&html.as_bytes().to_vec(), "".to_string());
let res: bool = html::has_favicon(&dom.document);
@@ -20,7 +20,7 @@ mod passing {
#[test]
fn shortcut_icon() {
- let html = "
text
";
+ let html = r#"
text
"#;
let dom = html::html_to_dom(&html.as_bytes().to_vec(), "".to_string());
let res: bool = html::has_favicon(&dom.document);