diff options
author | Aleksey Kladov <[email protected]> | 2018-09-02 14:36:03 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-09-02 14:36:03 +0100 |
commit | e98d8cd255ab5c2fee873a58af6c2c3ad561dab4 (patch) | |
tree | 04869b8fe93e724d8aa266177e48644051331ab9 /crates/server/tests/heavy_tests/main.rs | |
parent | 1329dd4e287c137ec0a90abeec0272275b2b2c8d (diff) |
nail down runnables
Diffstat (limited to 'crates/server/tests/heavy_tests/main.rs')
-rw-r--r-- | crates/server/tests/heavy_tests/main.rs | 40 |
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 | ||
15 | use support::project; | 15 | use support::project; |
16 | 16 | ||
17 | const LOG: &'static str = "WARN"; | 17 | const LOG: &'static str = ""; |
18 | 18 | ||
19 | #[test] | 19 | #[test] |
20 | fn test_runnables() { | 20 | fn 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] |
48 | fn test_runnables_project() { | ||
49 | let server = project(r#" | ||
50 | //- Cargo.toml | ||
51 | [package] | ||
52 | name = "foo" | ||
53 | version = "0.0.0" | ||
54 | |||
55 | //- src/lib.rs | ||
56 | pub fn foo() {} | ||
57 | |||
58 | //- tests/spam.rs | ||
59 | #[test] | ||
60 | fn 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] | ||
48 | fn test_project_model() { | 84 | fn test_project_model() { |
49 | let server = project(r#" | 85 | let server = project(r#" |
50 | //- Cargo.toml | 86 | //- Cargo.toml |