Skip to content

Commit

Permalink
helix-lsp-types: Resolve clippy lints in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis committed Jul 28, 2024
1 parent 3963969 commit 981e5cd
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions helix-lsp-types/src/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,20 +578,26 @@ mod tests {

#[test]
fn test_tag_support_deserialization() {
let mut empty = CompletionItemCapability::default();
empty.tag_support = None;
let empty = CompletionItemCapability {
tag_support: None,
..CompletionItemCapability::default()
};

test_deserialization(r#"{}"#, &empty);
test_deserialization(r#"{"tagSupport": false}"#, &empty);

let mut t = CompletionItemCapability::default();
t.tag_support = Some(TagSupport { value_set: vec![] });
let t = CompletionItemCapability {
tag_support: Some(TagSupport { value_set: vec![] }),
..CompletionItemCapability::default()
};
test_deserialization(r#"{"tagSupport": true}"#, &t);

let mut t = CompletionItemCapability::default();
t.tag_support = Some(TagSupport {
value_set: vec![CompletionItemTag::DEPRECATED],
});
let t = CompletionItemCapability {
tag_support: Some(TagSupport {
value_set: vec![CompletionItemTag::DEPRECATED],
}),
..CompletionItemCapability::default()
};
test_deserialization(r#"{"tagSupport": {"valueSet": [1]}}"#, &t);
}

Expand Down

0 comments on commit 981e5cd

Please sign in to comment.