-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove JSONRPC from TwoTypeOptionTests
- Loading branch information
1 parent
ac76fcc
commit ed1d883
Showing
1 changed file
with
9 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import XCTest | ||
import LanguageServerProtocol | ||
import JSONRPC | ||
|
||
class TwoTypeOptionTests: XCTestCase { | ||
func testDecodingKeyMissing() throws { | ||
let json = """ | ||
{"jsonrpc":"2.0","result":[{"title":"Organize Imports","kind":"source.organizeImports","edit":{"documentChanges":[{"textDocument":{"version":0,"uri":"file:///.go"},"edits":[{"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}},"newText":""}]}]}}],"id":2} | ||
final class TwoTypeOptionTests: XCTestCase { | ||
func testDecodingKeyMissing() throws { | ||
// this is a CodeAction, but being very dumb, I did not fully capture what I mean by "missing key" | ||
let json = """ | ||
[{"title":"Organize Imports","kind":"source.organizeImports","edit":{"documentChanges":[{"textDocument":{"version":0,"uri":"file:///.go"},"edits":[{"range":{"start":{"line":4,"character":0},"end":{"line":5,"character":0}},"newText":""}]}]}}] | ||
""" | ||
let data = try XCTUnwrap(json.data(using: .utf8)) | ||
let option = try JSONDecoder().decode(JSONRPCResponse<CodeActionResponse>.self, from: data) | ||
let data = try XCTUnwrap(json.data(using: .utf8)) | ||
let option = try JSONDecoder().decode(CodeActionResponse.self, from: data) | ||
|
||
XCTAssertNotNil(option) | ||
} | ||
XCTAssertNotNil(option) | ||
} | ||
} |