Install rustfmt in rustfmt test
This commit is contained in:
parent
09c20c8fcf
commit
ed47c93afe
4 changed files with 5 additions and 1 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -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)",
|
||||
]
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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]
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Reference in a new issue