aboutsummaryrefslogtreecommitdiff
path: root/crates/server/tests/heavy_tests/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/server/tests/heavy_tests/main.rs')
-rw-r--r--crates/server/tests/heavy_tests/main.rs40
1 files changed, 38 insertions, 2 deletions
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};
14 14
15use support::project; 15use support::project;
16 16
17const LOG: &'static str = "WARN"; 17const LOG: &'static str = "";
18 18
19#[test] 19#[test]
20fn test_runnables() { 20fn test_runnables_no_project() {
21 let server = project(r" 21 let server = project(r"
22//- lib.rs 22//- lib.rs
23#[test] 23#[test]
@@ -45,6 +45,42 @@ fn foo() {
45} 45}
46 46
47#[test] 47#[test]
48fn test_runnables_project() {
49 let server = project(r#"
50//- Cargo.toml
51[package]
52name = "foo"
53version = "0.0.0"
54
55//- src/lib.rs
56pub fn foo() {}
57
58//- tests/spam.rs
59#[test]
60fn test_eggs() {}
61"#);
62 server.wait_for_notification::<DidReloadWorkspace>();
63 server.request::<Runnables>(
64 RunnablesParams {
65 text_document: server.doc_id("tests/spam.rs"),
66 position: None,
67 },
68 r#"[
69 {
70 "args": [ "test", "--package", "foo", "--test", "spam", "--", "test_eggs", "--nocapture" ],
71 "bin": "cargo",
72 "env": { "RUST_BACKTRACE": "short" },
73 "label": "test test_eggs",
74 "range": {
75 "end": { "character": 17, "line": 1 },
76 "start": { "character": 0, "line": 0 }
77 }
78 }
79 ]"#
80 );
81}
82
83#[test]
48fn test_project_model() { 84fn test_project_model() {
49 let server = project(r#" 85 let server = project(r#"
50//- Cargo.toml 86//- Cargo.toml