Install rustfmt in rustfmt test

This commit is contained in:
Aleksander Vognild Burkow 2018-12-29 22:19:35 +01:00
parent 09c20c8fcf
commit ed47c93afe
4 changed files with 5 additions and 1 deletions

1
Cargo.lock generated
View file

@ -790,6 +790,7 @@ dependencies = [
"text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_worker 0.1.0",
"threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"tools 0.1.0",
"url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
]

View file

@ -33,6 +33,7 @@ ra_text_edit = { path = "../ra_text_edit" }
ra_analysis = { path = "../ra_analysis" }
gen_lsp_server = { path = "../gen_lsp_server" }
ra_vfs = { path = "../ra_vfs" }
tools = { path = "../tools" }
[dev-dependencies]
tempdir = "0.3.7"

View file

@ -121,6 +121,8 @@ fn test_eggs() {}
use std::collections::HashMap;
#[test]
fn test_format_document() {
tools::install_rustfmt().unwrap();
let server = project(
r#"
[package]

View file

@ -117,7 +117,7 @@ pub fn run_rustfmt(mode: Mode) -> Result<()> {
Ok(())
}
fn install_rustfmt() -> Result<()> {
pub fn install_rustfmt() -> Result<()> {
run(&format!("rustup install {}", TOOLCHAIN), ".")?;
run(
&format!("rustup component add rustfmt --toolchain {}", TOOLCHAIN),