formatting

This commit is contained in:
sagie gur ari 2020-04-05 07:48:59 +00:00
parent 57e0f49515
commit 81288b9288
2 changed files with 18 additions and 7 deletions

View file

@ -34,10 +34,13 @@ fn run_file_to_file() {
assert!(result.is_ok());
assert!(path.exists());
test::run_script_and_validate(vec![create("")], r#"
test::run_script_and_validate(
vec![create("")],
r#"
out = mv ./target/_duckscript/mv/run_file_to_file/1/file1.txt ./target/_duckscript/mv/run_file_to_file/2/file2.txt
"#,
CommandValidation::Match("out".to_string(), "true".to_string()),);
CommandValidation::Match("out".to_string(), "true".to_string()),
);
assert!(!path.exists());
path = Path::new("./target/_duckscript/mv/run_file_to_file/2/file2.txt");
@ -51,10 +54,13 @@ fn run_file_to_directory() {
assert!(result.is_ok());
assert!(path.exists());
test::run_script_and_validate(vec![create("")], r#"
test::run_script_and_validate(
vec![create("")],
r#"
out = mv ./target/_duckscript/mv/run_file_to_directory/1/file1.txt ./target/_duckscript/mv/run_file_to_directory/2
"#,
CommandValidation::Match("out".to_string(), "true".to_string()),);
CommandValidation::Match("out".to_string(), "true".to_string()),
);
assert!(!path.exists());
path = Path::new("./target/_duckscript/mv/run_file_to_directory/2/file1.txt");
@ -68,10 +74,13 @@ fn run_directory_to_directory() {
assert!(result.is_ok());
assert!(path.exists());
test::run_script_and_validate(vec![create("")], r#"
test::run_script_and_validate(
vec![create("")],
r#"
out = mv ./target/_duckscript/mv/run_directory_to_directory/1 ./target/_duckscript/mv/run_directory_to_directory/2
"#,
CommandValidation::Match("out".to_string(), "true".to_string()),);
CommandValidation::Match("out".to_string(), "true".to_string()),
);
assert!(!path.exists());
path = Path::new("./target/_duckscript/mv/run_directory_to_directory/2/1/1/file1.txt");

View file

@ -61,7 +61,9 @@ fn parse_options(arguments: &Vec<String>) -> Result<Options, String> {
"get" => options.method = Method::Get,
"post" => options.method = Method::Post,
_ => {
return Err(format!("Unsupported HTTP method: {}", argument).to_string());
return Err(
format!("Unsupported HTTP method: {}", argument).to_string()
);
}
};
}