Skip to content

Commit

Permalink
Update test data
Browse files Browse the repository at this point in the history
  • Loading branch information
matklad committed May 19, 2020
1 parent 3dd68c1 commit 914fc9b
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 46 deletions.
2 changes: 2 additions & 0 deletions crates/rust-analyzer/src/lsp_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,9 @@ pub struct CodeAction {
#[derive(Debug, Eq, PartialEq, Clone, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct SnippetWorkspaceEdit {
#[serde(skip_serializing_if = "Option::is_none")]
pub changes: Option<HashMap<lsp_types::Url, Vec<lsp_types::TextEdit>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub document_changes: Option<Vec<SnippetDocumentChangeOperation>>,
}

Expand Down
52 changes: 14 additions & 38 deletions crates/rust-analyzer/tests/heavy_tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,29 +333,17 @@ fn main() {}
partial_result_params: PartialResultParams::default(),
work_done_progress_params: WorkDoneProgressParams::default(),
},
json!([
{
"command": {
"arguments": [
json!([{
"edit": {
"documentChanges": [
{
"cursorPosition": null,
"label": "Create module",
"workspaceEdit": {
"documentChanges": [
{
"kind": "create",
"uri": "file:///[..]/src/bar.rs"
}
]
}
"kind": "create",
"uri": "file:///[..]/src/bar.rs"
}
],
"command": "rust-analyzer.applySourceChange",
"title": "Create module"
]
},
"title": "Create module"
}
]),
}]),
);

server.request::<CodeActionRequest>(
Expand Down Expand Up @@ -416,29 +404,17 @@ fn main() {{}}
partial_result_params: PartialResultParams::default(),
work_done_progress_params: WorkDoneProgressParams::default(),
},
json!([
{
"command": {
"arguments": [
json!([{
"edit": {
"documentChanges": [
{
"cursorPosition": null,
"label": "Create module",
"workspaceEdit": {
"documentChanges": [
{
"kind": "create",
"uri": "file:///[..]/src/bar.rs"
}
]
}
"kind": "create",
"uri": "file://[..]/src/bar.rs"
}
],
"command": "rust-analyzer.applySourceChange",
"title": "Create module"
]
},
"title": "Create module"
}
]),
}]),
);

server.request::<CodeActionRequest>(
Expand Down
17 changes: 9 additions & 8 deletions crates/test_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,14 +471,15 @@ pub fn read_text(path: &Path) -> String {
/// also creates a file at `./target/.slow_tests_cookie` which serves as a flag
/// that slow tests did run.
pub fn skip_slow_tests() -> bool {
let should_skip = std::env::var("CI").is_err() && std::env::var("RUN_SLOW_TESTS").is_err();
if should_skip {
eprintln!("ignoring slow test")
} else {
let path = project_dir().join("./target/.slow_tests_cookie");
fs::write(&path, ".").unwrap();
}
should_skip
// let should_skip = std::env::var("CI").is_err() && std::env::var("RUN_SLOW_TESTS").is_err();
// if should_skip {
// eprintln!("ignoring slow test")
// } else {
// let path = project_dir().join("./target/.slow_tests_cookie");
// fs::write(&path, ".").unwrap();
// }
// should_skip
false
}

const REWRITE: bool = false;
Expand Down

0 comments on commit 914fc9b

Please sign in to comment.