From e98d8cd255ab5c2fee873a58af6c2c3ad561dab4 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 2 Sep 2018 16:36:03 +0300 Subject: nail down runnables --- crates/server/tests/heavy_tests/main.rs | 40 +++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) (limited to 'crates/server/tests/heavy_tests/main.rs') diff --git a/crates/server/tests/heavy_tests/main.rs b/crates/server/tests/heavy_tests/main.rs index 9c0196f22..0dc6074b2 100644 --- a/crates/server/tests/heavy_tests/main.rs +++ b/crates/server/tests/heavy_tests/main.rs @@ -14,10 +14,10 @@ use m::req::{Runnables, RunnablesParams, DidReloadWorkspace}; use support::project; -const LOG: &'static str = "WARN"; +const LOG: &'static str = ""; #[test] -fn test_runnables() { +fn test_runnables_no_project() { let server = project(r" //- lib.rs #[test] @@ -44,6 +44,42 @@ fn foo() { ); } +#[test] +fn test_runnables_project() { + let server = project(r#" +//- Cargo.toml +[package] +name = "foo" +version = "0.0.0" + +//- src/lib.rs +pub fn foo() {} + +//- tests/spam.rs +#[test] +fn test_eggs() {} +"#); + server.wait_for_notification::(); + server.request::( + RunnablesParams { + text_document: server.doc_id("tests/spam.rs"), + position: None, + }, + r#"[ + { + "args": [ "test", "--package", "foo", "--test", "spam", "--", "test_eggs", "--nocapture" ], + "bin": "cargo", + "env": { "RUST_BACKTRACE": "short" }, + "label": "test test_eggs", + "range": { + "end": { "character": 17, "line": 1 }, + "start": { "character": 0, "line": 0 } + } + } + ]"# + ); +} + #[test] fn test_project_model() { let server = project(r#" -- cgit v1.2.3