Merge pull request #286 from snshn/move-test-data
Move test data files under _data_
This commit is contained in:
commit
de492caaa5
23 changed files with 39 additions and 39 deletions
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 296 B After Width: | Height: | Size: 296 B |
|
@ -77,8 +77,8 @@ mod passing {
|
||||||
#[test]
|
#[test]
|
||||||
fn css_import_string() {
|
fn css_import_string() {
|
||||||
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
||||||
let path_html: &Path = Path::new("tests/data/css/index.html");
|
let path_html: &Path = Path::new("tests/_data_/css/index.html");
|
||||||
let path_css: &Path = Path::new("tests/data/css/style.css");
|
let path_css: &Path = Path::new("tests/_data_/css/style.css");
|
||||||
|
|
||||||
assert!(path_html.is_file());
|
assert!(path_html.is_file());
|
||||||
assert!(path_css.is_file());
|
assert!(path_css.is_file());
|
||||||
|
|
|
@ -27,7 +27,7 @@ mod passing {
|
||||||
let out = cmd
|
let out = cmd
|
||||||
.arg("-M")
|
.arg("-M")
|
||||||
.arg(format!(
|
.arg(format!(
|
||||||
"tests{s}data{s}basic{s}local-file.html",
|
"tests{s}_data_{s}basic{s}local-file.html",
|
||||||
s = MAIN_SEPARATOR
|
s = MAIN_SEPARATOR
|
||||||
))
|
))
|
||||||
.output()
|
.output()
|
||||||
|
@ -39,11 +39,11 @@ mod passing {
|
||||||
String::from_utf8_lossy(&out.stderr),
|
String::from_utf8_lossy(&out.stderr),
|
||||||
format!(
|
format!(
|
||||||
"\
|
"\
|
||||||
{file}{cwd}/tests/data/basic/local-file.html\n \
|
{file}{cwd}/tests/_data_/basic/local-file.html\n \
|
||||||
{file}{cwd}/tests/data/basic/local-style.css\n \
|
{file}{cwd}/tests/_data_/basic/local-style.css\n \
|
||||||
{file}{cwd}/tests/data/basic/local-style-does-not-exist.css (not found)\n \
|
{file}{cwd}/tests/_data_/basic/local-style-does-not-exist.css (not found)\n \
|
||||||
{file}{cwd}/tests/data/basic/monolith.png (not found)\n \
|
{file}{cwd}/tests/_data_/basic/monolith.png (not found)\n \
|
||||||
{file}{cwd}/tests/data/basic/local-script.js\n\
|
{file}{cwd}/tests/_data_/basic/local-script.js\n\
|
||||||
",
|
",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd_normalized
|
cwd = cwd_normalized
|
||||||
|
@ -74,7 +74,7 @@ mod passing {
|
||||||
#[test]
|
#[test]
|
||||||
fn local_file_target_input_absolute_target_path() {
|
fn local_file_target_input_absolute_target_path() {
|
||||||
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
||||||
let path_html: &Path = Path::new("tests/data/basic/local-file.html");
|
let path_html: &Path = Path::new("tests/_data_/basic/local-file.html");
|
||||||
|
|
||||||
let out = cmd
|
let out = cmd
|
||||||
.arg("-M")
|
.arg("-M")
|
||||||
|
@ -130,7 +130,7 @@ mod passing {
|
||||||
.arg("-M")
|
.arg("-M")
|
||||||
.arg("-cji")
|
.arg("-cji")
|
||||||
.arg(format!(
|
.arg(format!(
|
||||||
"{file}{cwd}/tests/data/basic/local-file.html",
|
"{file}{cwd}/tests/_data_/basic/local-file.html",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd_normalized,
|
cwd = cwd_normalized,
|
||||||
))
|
))
|
||||||
|
@ -141,7 +141,7 @@ mod passing {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
String::from_utf8_lossy(&out.stderr),
|
String::from_utf8_lossy(&out.stderr),
|
||||||
format!(
|
format!(
|
||||||
"{file}{cwd}/tests/data/basic/local-file.html\n",
|
"{file}{cwd}/tests/_data_/basic/local-file.html\n",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd_normalized,
|
cwd = cwd_normalized,
|
||||||
)
|
)
|
||||||
|
@ -175,8 +175,8 @@ mod passing {
|
||||||
#[test]
|
#[test]
|
||||||
fn embed_file_url_local_asset_within_style_attribute() {
|
fn embed_file_url_local_asset_within_style_attribute() {
|
||||||
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
||||||
let path_html: &Path = Path::new("tests/data/svg/index.html");
|
let path_html: &Path = Path::new("tests/_data_/svg/index.html");
|
||||||
let path_svg: &Path = Path::new("tests/data/svg/image.svg");
|
let path_svg: &Path = Path::new("tests/_data_/svg/image.svg");
|
||||||
|
|
||||||
let out = cmd.arg("-M").arg(path_html.as_os_str()).output().unwrap();
|
let out = cmd.arg("-M").arg(path_html.as_os_str()).output().unwrap();
|
||||||
|
|
||||||
|
@ -217,13 +217,13 @@ mod passing {
|
||||||
.arg("-i")
|
.arg("-i")
|
||||||
.arg(if cfg!(windows) {
|
.arg(if cfg!(windows) {
|
||||||
format!(
|
format!(
|
||||||
"{file}{cwd}/tests/data/integrity/index.html",
|
"{file}{cwd}/tests/_data_/integrity/index.html",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd_normalized,
|
cwd = cwd_normalized,
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
format!(
|
format!(
|
||||||
"{file}{cwd}/tests/data/integrity/index.html",
|
"{file}{cwd}/tests/_data_/integrity/index.html",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd_normalized,
|
cwd = cwd_normalized,
|
||||||
)
|
)
|
||||||
|
@ -236,11 +236,11 @@ mod passing {
|
||||||
String::from_utf8_lossy(&out.stderr),
|
String::from_utf8_lossy(&out.stderr),
|
||||||
format!(
|
format!(
|
||||||
"\
|
"\
|
||||||
{file}{cwd}/tests/data/integrity/index.html\n \
|
{file}{cwd}/tests/_data_/integrity/index.html\n \
|
||||||
{file}{cwd}/tests/data/integrity/style.css\n \
|
{file}{cwd}/tests/_data_/integrity/style.css\n \
|
||||||
{file}{cwd}/tests/data/integrity/style.css\n \
|
{file}{cwd}/tests/_data_/integrity/style.css\n \
|
||||||
{file}{cwd}/tests/data/integrity/script.js\n \
|
{file}{cwd}/tests/_data_/integrity/script.js\n \
|
||||||
{file}{cwd}/tests/data/integrity/script.js\n\
|
{file}{cwd}/tests/_data_/integrity/script.js\n\
|
||||||
",
|
",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd_normalized,
|
cwd = cwd_normalized,
|
||||||
|
|
|
@ -17,8 +17,8 @@ mod passing {
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_noscript_contents() {
|
fn parse_noscript_contents() {
|
||||||
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
||||||
let path_html: &Path = Path::new("tests/data/noscript/index.html");
|
let path_html: &Path = Path::new("tests/_data_/noscript/index.html");
|
||||||
let path_svg: &Path = Path::new("tests/data/noscript/image.svg");
|
let path_svg: &Path = Path::new("tests/_data_/noscript/image.svg");
|
||||||
|
|
||||||
let out = cmd.arg("-M").arg(path_html.as_os_str()).output().unwrap();
|
let out = cmd.arg("-M").arg(path_html.as_os_str()).output().unwrap();
|
||||||
|
|
||||||
|
@ -48,8 +48,8 @@ mod passing {
|
||||||
#[test]
|
#[test]
|
||||||
fn unwrap_noscript_contents() {
|
fn unwrap_noscript_contents() {
|
||||||
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
||||||
let path_html: &Path = Path::new("tests/data/noscript/index.html");
|
let path_html: &Path = Path::new("tests/_data_/noscript/index.html");
|
||||||
let path_svg: &Path = Path::new("tests/data/noscript/image.svg");
|
let path_svg: &Path = Path::new("tests/_data_/noscript/image.svg");
|
||||||
|
|
||||||
let out = cmd.arg("-Mn").arg(path_html.as_os_str()).output().unwrap();
|
let out = cmd.arg("-Mn").arg(path_html.as_os_str()).output().unwrap();
|
||||||
|
|
||||||
|
@ -79,8 +79,8 @@ mod passing {
|
||||||
#[test]
|
#[test]
|
||||||
fn unwrap_noscript_contents_nested() {
|
fn unwrap_noscript_contents_nested() {
|
||||||
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
||||||
let path_html: &Path = Path::new("tests/data/noscript/nested.html");
|
let path_html: &Path = Path::new("tests/_data_/noscript/nested.html");
|
||||||
let path_svg: &Path = Path::new("tests/data/noscript/image.svg");
|
let path_svg: &Path = Path::new("tests/_data_/noscript/image.svg");
|
||||||
|
|
||||||
let out = cmd.arg("-Mn").arg(path_html.as_os_str()).output().unwrap();
|
let out = cmd.arg("-Mn").arg(path_html.as_os_str()).output().unwrap();
|
||||||
|
|
||||||
|
@ -110,8 +110,8 @@ mod passing {
|
||||||
#[test]
|
#[test]
|
||||||
fn unwrap_noscript_contents_with_script() {
|
fn unwrap_noscript_contents_with_script() {
|
||||||
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
let mut cmd = Command::cargo_bin(env!("CARGO_PKG_NAME")).unwrap();
|
||||||
let path_html: &Path = Path::new("tests/data/noscript/script.html");
|
let path_html: &Path = Path::new("tests/_data_/noscript/script.html");
|
||||||
let path_svg: &Path = Path::new("tests/data/noscript/image.svg");
|
let path_svg: &Path = Path::new("tests/_data_/noscript/image.svg");
|
||||||
|
|
||||||
let out = cmd.arg("-Mn").arg(path_html.as_os_str()).output().unwrap();
|
let out = cmd.arg("-Mn").arg(path_html.as_os_str()).output().unwrap();
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ mod passing {
|
||||||
let out = cmd
|
let out = cmd
|
||||||
.arg("-M")
|
.arg("-M")
|
||||||
.arg(format!(
|
.arg(format!(
|
||||||
"tests{s}data{s}unusual_encodings{s}gb2312.html",
|
"tests{s}_data_{s}unusual_encodings{s}gb2312.html",
|
||||||
s = MAIN_SEPARATOR
|
s = MAIN_SEPARATOR
|
||||||
))
|
))
|
||||||
.output()
|
.output()
|
||||||
|
@ -32,7 +32,7 @@ mod passing {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
String::from_utf8_lossy(&out.stderr),
|
String::from_utf8_lossy(&out.stderr),
|
||||||
format!(
|
format!(
|
||||||
"{file}{cwd}/tests/data/unusual_encodings/gb2312.html\n",
|
"{file}{cwd}/tests/_data_/unusual_encodings/gb2312.html\n",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd_normalized,
|
cwd = cwd_normalized,
|
||||||
)
|
)
|
||||||
|
@ -67,7 +67,7 @@ mod passing {
|
||||||
fn properly_save_document_with_gb2312_from_stdin() {
|
fn properly_save_document_with_gb2312_from_stdin() {
|
||||||
let mut echo = Command::new("cat")
|
let mut echo = Command::new("cat")
|
||||||
.arg(format!(
|
.arg(format!(
|
||||||
"tests{s}data{s}unusual_encodings{s}gb2312.html",
|
"tests{s}_data_{s}unusual_encodings{s}gb2312.html",
|
||||||
s = MAIN_SEPARATOR
|
s = MAIN_SEPARATOR
|
||||||
))
|
))
|
||||||
.stdout(Stdio::piped())
|
.stdout(Stdio::piped())
|
||||||
|
@ -118,7 +118,7 @@ mod passing {
|
||||||
.arg("-C")
|
.arg("-C")
|
||||||
.arg("utf8")
|
.arg("utf8")
|
||||||
.arg(format!(
|
.arg(format!(
|
||||||
"tests{s}data{s}unusual_encodings{s}gb2312.html",
|
"tests{s}_data_{s}unusual_encodings{s}gb2312.html",
|
||||||
s = MAIN_SEPARATOR
|
s = MAIN_SEPARATOR
|
||||||
))
|
))
|
||||||
.output()
|
.output()
|
||||||
|
@ -129,7 +129,7 @@ mod passing {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
String::from_utf8_lossy(&out.stderr),
|
String::from_utf8_lossy(&out.stderr),
|
||||||
format!(
|
format!(
|
||||||
"{file}{cwd}/tests/data/unusual_encodings/gb2312.html\n",
|
"{file}{cwd}/tests/_data_/unusual_encodings/gb2312.html\n",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd_normalized,
|
cwd = cwd_normalized,
|
||||||
)
|
)
|
||||||
|
@ -161,7 +161,7 @@ mod passing {
|
||||||
.arg("-C")
|
.arg("-C")
|
||||||
.arg("utf0")
|
.arg("utf0")
|
||||||
.arg(format!(
|
.arg(format!(
|
||||||
"tests{s}data{s}unusual_encodings{s}gb2312.html",
|
"tests{s}_data_{s}unusual_encodings{s}gb2312.html",
|
||||||
s = MAIN_SEPARATOR
|
s = MAIN_SEPARATOR
|
||||||
))
|
))
|
||||||
.output()
|
.output()
|
||||||
|
@ -203,7 +203,7 @@ mod failing {
|
||||||
let out = cmd
|
let out = cmd
|
||||||
.arg("-M")
|
.arg("-M")
|
||||||
.arg(format!(
|
.arg(format!(
|
||||||
"tests{s}data{s}unusual_encodings{s}iso-8859-1.html",
|
"tests{s}_data_{s}unusual_encodings{s}iso-8859-1.html",
|
||||||
s = MAIN_SEPARATOR
|
s = MAIN_SEPARATOR
|
||||||
))
|
))
|
||||||
.output()
|
.output()
|
||||||
|
@ -214,7 +214,7 @@ mod failing {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
String::from_utf8_lossy(&out.stderr),
|
String::from_utf8_lossy(&out.stderr),
|
||||||
format!(
|
format!(
|
||||||
"{file}{cwd}/tests/data/unusual_encodings/iso-8859-1.html\n",
|
"{file}{cwd}/tests/_data_/unusual_encodings/iso-8859-1.html\n",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd_normalized,
|
cwd = cwd_normalized,
|
||||||
)
|
)
|
||||||
|
|
|
@ -63,13 +63,13 @@ mod passing {
|
||||||
cache,
|
cache,
|
||||||
&client,
|
&client,
|
||||||
&Url::parse(&format!(
|
&Url::parse(&format!(
|
||||||
"{file}{cwd}/tests/data/basic/local-file.html",
|
"{file}{cwd}/tests/_data_/basic/local-file.html",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd.to_str().unwrap()
|
cwd = cwd.to_str().unwrap()
|
||||||
))
|
))
|
||||||
.unwrap(),
|
.unwrap(),
|
||||||
&Url::parse(&format!(
|
&Url::parse(&format!(
|
||||||
"{file}{cwd}/tests/data/basic/local-script.js",
|
"{file}{cwd}/tests/_data_/basic/local-script.js",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd.to_str().unwrap()
|
cwd = cwd.to_str().unwrap()
|
||||||
))
|
))
|
||||||
|
@ -84,7 +84,7 @@ mod passing {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
final_url,
|
final_url,
|
||||||
Url::parse(&format!(
|
Url::parse(&format!(
|
||||||
"{file}{cwd}/tests/data/basic/local-script.js",
|
"{file}{cwd}/tests/_data_/basic/local-script.js",
|
||||||
file = file_url_protocol,
|
file = file_url_protocol,
|
||||||
cwd = cwd.to_str().unwrap()
|
cwd = cwd.to_str().unwrap()
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in a new issue