chore: Run latest rustfmt

master
Jesper Håkansson 7 years ago
parent 23e902bd7e
commit 65d060cfc4
  1. 5
      src/error.rs
  2. 14
      tests/all/bindgen.rs
  3. 19
      tests/all/manifest.rs

@ -49,10 +49,7 @@ pub enum Error {
/// An error invoking another CLI tool. /// An error invoking another CLI tool.
#[fail( #[fail(
display = "Process exited with {}: {}.\n\nstdout:{}\n\nstderr:\n\n{}", display = "Process exited with {}: {}.\n\nstdout:{}\n\nstderr:\n\n{}",
exit_status, exit_status, message, stdout, stderr
message,
stdout,
stderr
)] )]
Cli { Cli {
/// Error message. /// Error message.

@ -11,20 +11,18 @@ fn can_download_prebuilt_wasm_bindgen() {
use std::env; use std::env;
let dir = tempfile::TempDir::new().unwrap(); let dir = tempfile::TempDir::new().unwrap();
bindgen::download_prebuilt_wasm_bindgen(dir.path(), "0.2.21").unwrap(); bindgen::download_prebuilt_wasm_bindgen(dir.path(), "0.2.21").unwrap();
assert!( assert!(dir
dir.path() .path()
.join("bin") .join("bin")
.join("wasm-bindgen") .join("wasm-bindgen")
.with_extension(env::consts::EXE_EXTENSION) .with_extension(env::consts::EXE_EXTENSION)
.is_file() .is_file());
); assert!(dir
assert!( .path()
dir.path()
.join("bin") .join("bin")
.join("wasm-bindgen-test-runner") .join("wasm-bindgen-test-runner")
.with_extension(env::consts::EXE_EXTENSION) .with_extension(env::consts::EXE_EXTENSION)
.is_file() .is_file());
);
} }
#[test] #[test]

@ -121,8 +121,7 @@ fn it_creates_a_package_json_provided_path_with_scope() {
let out_dir = fixture.path.join("pkg"); let out_dir = fixture.path.join("pkg");
let step = wasm_pack::progressbar::Step::new(1); let step = wasm_pack::progressbar::Step::new(1);
wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap(); wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap();
assert!( assert!(manifest::write_package_json(
manifest::write_package_json(
&fixture.path, &fixture.path,
&out_dir, &out_dir,
&Some("test".to_string()), &Some("test".to_string()),
@ -130,8 +129,7 @@ fn it_creates_a_package_json_provided_path_with_scope() {
"", "",
&step &step
) )
.is_ok() .is_ok());
);
let package_json_path = &fixture.path.join("pkg").join("package.json"); let package_json_path = &fixture.path.join("pkg").join("package.json");
assert!(fs::metadata(package_json_path).is_ok()); assert!(fs::metadata(package_json_path).is_ok());
assert!(utils::manifest::read_package_json(&fixture.path, &out_dir).is_ok()); assert!(utils::manifest::read_package_json(&fixture.path, &out_dir).is_ok());
@ -192,10 +190,15 @@ fn it_creates_a_pkg_json_with_correct_files_on_nomodules() {
let out_dir = fixture.path.join("pkg"); let out_dir = fixture.path.join("pkg");
let step = wasm_pack::progressbar::Step::new(1); let step = wasm_pack::progressbar::Step::new(1);
wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap(); wasm_pack::command::utils::create_pkg_dir(&out_dir, &step).unwrap();
assert!( assert!(manifest::write_package_json(
manifest::write_package_json(&fixture.path, &out_dir, &None, false, "no-modules", &step) &fixture.path,
.is_ok() &out_dir,
); &None,
false,
"no-modules",
&step
)
.is_ok());
let package_json_path = &out_dir.join("package.json"); let package_json_path = &out_dir.join("package.json");
assert!(fs::metadata(package_json_path).is_ok()); assert!(fs::metadata(package_json_path).is_ok());
utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap(); utils::manifest::read_package_json(&fixture.path, &out_dir).unwrap();

Loading…
Cancel
Save