Skip to content

Commit

Permalink
Remove JSONRPC from TwoTypeOptionTests
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Apr 6, 2024
1 parent ac76fcc commit ed1d883
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Tests/LanguageServerProtocolTests/TwoTypeOptionTests.swift
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)
}
}

0 comments on commit ed1d883

Please sign in to comment.