mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-02 11:44:28 +00:00
add tests for crlf
This commit is contained in:
parent
ccca427ce4
commit
de3f2948ea
@ -414,3 +414,49 @@ fn main() {{}}
|
||||
let elapsed = start.elapsed();
|
||||
assert!(elapsed.as_millis() < 2000, "typing enter took {:?}", elapsed);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn preserves_dos_line_endings() {
|
||||
let server = Project::with_fixture(
|
||||
&r#"
|
||||
//- Cargo.toml
|
||||
[package]
|
||||
name = "foo"
|
||||
version = "0.0.0"
|
||||
|
||||
//- src/main.rs
|
||||
/// Some Docs\r\nfn main() {}
|
||||
"#,
|
||||
)
|
||||
.server();
|
||||
|
||||
server.request::<OnEnter>(
|
||||
TextDocumentPositionParams {
|
||||
text_document: server.doc_id("src/main.rs"),
|
||||
position: Position { line: 0, character: 8 },
|
||||
},
|
||||
json!({
|
||||
"cursorPosition": {
|
||||
"position": { "line": 1, "character": 4 },
|
||||
"textDocument": { "uri": "file:///[..]src/main.rs" }
|
||||
},
|
||||
"label": "on enter",
|
||||
"workspaceEdit": {
|
||||
"documentChanges": [
|
||||
{
|
||||
"edits": [
|
||||
{
|
||||
"newText": "\r\n/// ",
|
||||
"range": {
|
||||
"end": { "line": 0, "character": 8 },
|
||||
"start": { "line": 0, "character": 8 }
|
||||
}
|
||||
}
|
||||
],
|
||||
"textDocument": { "uri": "file:///[..]src/main.rs", "version": null }
|
||||
}
|
||||
]
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user