mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
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)",
|
"text_unit 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"thread_worker 0.1.0",
|
"thread_worker 0.1.0",
|
||||||
"threadpool 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"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)",
|
"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" }
|
ra_analysis = { path = "../ra_analysis" }
|
||||||
gen_lsp_server = { path = "../gen_lsp_server" }
|
gen_lsp_server = { path = "../gen_lsp_server" }
|
||||||
ra_vfs = { path = "../ra_vfs" }
|
ra_vfs = { path = "../ra_vfs" }
|
||||||
|
tools = { path = "../tools" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
tempdir = "0.3.7"
|
tempdir = "0.3.7"
|
||||||
|
|
|
@ -121,6 +121,8 @@ fn test_eggs() {}
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
#[test]
|
#[test]
|
||||||
fn test_format_document() {
|
fn test_format_document() {
|
||||||
|
tools::install_rustfmt().unwrap();
|
||||||
|
|
||||||
let server = project(
|
let server = project(
|
||||||
r#"
|
r#"
|
||||||
[package]
|
[package]
|
||||||
|
|
|
@ -117,7 +117,7 @@ pub fn run_rustfmt(mode: Mode) -> Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn install_rustfmt() -> Result<()> {
|
pub fn install_rustfmt() -> Result<()> {
|
||||||
run(&format!("rustup install {}", TOOLCHAIN), ".")?;
|
run(&format!("rustup install {}", TOOLCHAIN), ".")?;
|
||||||
run(
|
run(
|
||||||
&format!("rustup component add rustfmt --toolchain {}", TOOLCHAIN),
|
&format!("rustup component add rustfmt --toolchain {}", TOOLCHAIN),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue