aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/tests/heavy_tests
diff options
context:
space:
mode:
authorbors[bot] <bors[bot]@users.noreply.github.com>2019-03-07 17:35:57 +0000
committerbors[bot] <bors[bot]@users.noreply.github.com>2019-03-07 17:35:57 +0000
commit4ce962f64e219a9e65f080fe98ebaba2008ae64e (patch)
treeefef5a5182da80add3a8bf78c27c89e794d452b4 /crates/ra_lsp_server/tests/heavy_tests
parentf8f24cb869cd5755d3de77ed3782741761f99e18 (diff)
parent84e1d50a2a408efc9972d04361c224da2eea8980 (diff)
Merge #948
948: Fix test_missing_module_code_action_in_json_project on Windows r=matklad a=vipentti The test would fail on Windows due to the paths not being properly escaped for JSON. In addition adds extra braces around the fn main to actually introduce braces in the file. Co-authored-by: Ville Penttinen <[email protected]>
Diffstat (limited to 'crates/ra_lsp_server/tests/heavy_tests')
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index 6ae541ec6..407719080 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -263,20 +263,25 @@ fn main() {}
263#[test] 263#[test]
264fn test_missing_module_code_action_in_json_project() { 264fn test_missing_module_code_action_in_json_project() {
265 let tmp_dir = TempDir::new().unwrap(); 265 let tmp_dir = TempDir::new().unwrap();
266
267 let path = tmp_dir.path();
268
269 let project = json!({
270 "roots": [path],
271 "crates": [ { "root_module": path.join("src/lib.rs"), "deps": [], "edition": "2015" } ]
272 });
273
266 let code = format!( 274 let code = format!(
267 r#" 275 r#"
268//- rust-project.json 276//- rust-project.json
269{{ 277{PROJECT}
270 "roots": [ "{PATH}" ],
271 "crates": [ {{ "root_module": "{PATH}/src/lib.rs", "deps": [], "edition": "2015" }} ]
272}}
273 278
274//- src/lib.rs 279//- src/lib.rs
275mod bar; 280mod bar;
276 281
277fn main() {} 282fn main() {{}}
278"#, 283"#,
279 PATH = tmp_dir.path().display() 284 PROJECT = project.to_string(),
280 ); 285 );
281 let server = project_with_tmpdir(tmp_dir, &code); 286 let server = project_with_tmpdir(tmp_dir, &code);
282 server.wait_until_workspace_is_loaded(); 287 server.wait_until_workspace_is_loaded();