aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_lsp_server/tests/heavy_tests
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-08-20 16:26:07 +0100
committerAleksey Kladov <[email protected]>2019-08-20 17:53:05 +0100
commitde3f2948ea2416d65640c07d2c69df75a4273d50 (patch)
tree7180fc61d02776ce6318f0ecc9c8b6c4450fb062 /crates/ra_lsp_server/tests/heavy_tests
parentccca427ce45d18d80b1876a7c5b05cf3205b86e5 (diff)
add tests for crlf
Diffstat (limited to 'crates/ra_lsp_server/tests/heavy_tests')
-rw-r--r--crates/ra_lsp_server/tests/heavy_tests/main.rs46
1 files changed, 46 insertions, 0 deletions
diff --git a/crates/ra_lsp_server/tests/heavy_tests/main.rs b/crates/ra_lsp_server/tests/heavy_tests/main.rs
index de3bd5bc5..ec075a2fd 100644
--- a/crates/ra_lsp_server/tests/heavy_tests/main.rs
+++ b/crates/ra_lsp_server/tests/heavy_tests/main.rs
@@ -414,3 +414,49 @@ fn main() {{}}
414 let elapsed = start.elapsed(); 414 let elapsed = start.elapsed();
415 assert!(elapsed.as_millis() < 2000, "typing enter took {:?}", elapsed); 415 assert!(elapsed.as_millis() < 2000, "typing enter took {:?}", elapsed);
416} 416}
417
418#[test]
419fn preserves_dos_line_endings() {
420 let server = Project::with_fixture(
421 &r#"
422//- Cargo.toml
423[package]
424name = "foo"
425version = "0.0.0"
426
427//- src/main.rs
428/// Some Docs\r\nfn main() {}
429"#,
430 )
431 .server();
432
433 server.request::<OnEnter>(
434 TextDocumentPositionParams {
435 text_document: server.doc_id("src/main.rs"),
436 position: Position { line: 0, character: 8 },
437 },
438 json!({
439 "cursorPosition": {
440 "position": { "line": 1, "character": 4 },
441 "textDocument": { "uri": "file:///[..]src/main.rs" }
442 },
443 "label": "on enter",
444 "workspaceEdit": {
445 "documentChanges": [
446 {
447 "edits": [
448 {
449 "newText": "\r\n/// ",
450 "range": {
451 "end": { "line": 0, "character": 8 },
452 "start": { "line": 0, "character": 8 }
453 }
454 }
455 ],
456 "textDocument": { "uri": "file:///[..]src/main.rs", "version": null }
457 }
458 ]
459 }
460 }),
461 );
462}