diff options
author | Aleksey Kladov <[email protected]> | 2018-09-02 12:46:15 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-09-02 12:46:15 +0100 |
commit | 80be61ed78e8410e013cb94879435d54a4907c30 (patch) | |
tree | 3ab33c902644a3aa14b490be8a7caa9120da7537 /crates/server/tests/heavy_tests/main.rs | |
parent | 7fad13de73ded5b8a332c5f50c18671d612bd1e3 (diff) |
project model
Diffstat (limited to 'crates/server/tests/heavy_tests/main.rs')
-rw-r--r-- | crates/server/tests/heavy_tests/main.rs | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/crates/server/tests/heavy_tests/main.rs b/crates/server/tests/heavy_tests/main.rs index 94c8243b0..9c0196f22 100644 --- a/crates/server/tests/heavy_tests/main.rs +++ b/crates/server/tests/heavy_tests/main.rs | |||
@@ -1,5 +1,6 @@ | |||
1 | extern crate tempdir; | 1 | #[macro_use] |
2 | extern crate crossbeam_channel; | 2 | extern crate crossbeam_channel; |
3 | extern crate tempdir; | ||
3 | extern crate languageserver_types; | 4 | extern crate languageserver_types; |
4 | extern crate serde; | 5 | extern crate serde; |
5 | extern crate serde_json; | 6 | extern crate serde_json; |
@@ -9,10 +10,12 @@ extern crate m; | |||
9 | 10 | ||
10 | mod support; | 11 | mod support; |
11 | 12 | ||
12 | use m::req::{Runnables, RunnablesParams}; | 13 | use m::req::{Runnables, RunnablesParams, DidReloadWorkspace}; |
13 | 14 | ||
14 | use support::project; | 15 | use support::project; |
15 | 16 | ||
17 | const LOG: &'static str = "WARN"; | ||
18 | |||
16 | #[test] | 19 | #[test] |
17 | fn test_runnables() { | 20 | fn test_runnables() { |
18 | let server = project(r" | 21 | let server = project(r" |
@@ -40,3 +43,32 @@ fn foo() { | |||
40 | ]"# | 43 | ]"# |
41 | ); | 44 | ); |
42 | } | 45 | } |
46 | |||
47 | #[test] | ||
48 | fn test_project_model() { | ||
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 | server.notification::<DidReloadWorkspace>(r#"[ | ||
59 | { | ||
60 | "packages": [ | ||
61 | { | ||
62 | "manifest": "$PROJECT_ROOT$/Cargo.toml", | ||
63 | "name": "foo", | ||
64 | "targets": [ 0 ] | ||
65 | } | ||
66 | ], | ||
67 | "targets": [ | ||
68 | { "kind": "Lib", "name": "foo", "pkg": 0, "root": "$PROJECT_ROOT$/src/lib.rs" } | ||
69 | ], | ||
70 | "ws_members": [ 0 ] | ||
71 | } | ||
72 | ]"# | ||
73 | ); | ||
74 | } | ||