Files
sourcekit-lsp/Tests/LanguageServerProtocolTests/LanguageServerProtocolTests.swift
David Goldman 81e2688c5d Support for clangd's go-to-definition for #include/#import (#247)
* Support for clangd's go-to-definition for header files

- By forwarding the request to clangd when it fails to give
  symbol information, we are able to use its built in
  go-to-definition support for headers (jump to header file)

* Add static tibs test for clangd go-to-#include

* Move #include test to SourceKitTests and regenerate linux main

* Fix improper escaping of %40 in file URLs

* Add URL escaping test

* Another attempt to fix broken BuildServerBuildSystemTests test on Linux

- URL's `standardizedFileURL` removes trailing slashes from file URLs,
  but only on Linux
2020-03-13 19:20:25 -04:00

36 lines
1.3 KiB
Swift

//===----------------------------------------------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2018 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
import LanguageServerProtocol
import XCTest
final class LanguageServerProtocolTests: XCTestCase {
func testLanguageXFlag() {
XCTAssertEqual(Language.c.xflag, "c")
XCTAssertEqual(Language.c.xflagHeader, "c-header")
XCTAssertEqual(Language.cpp.xflag, "c++")
XCTAssertEqual(Language.cpp.xflagHeader, "c++-header")
XCTAssertEqual(Language.objective_c.xflag, "objective-c")
XCTAssertEqual(Language.objective_c.xflagHeader, "objective-c-header")
XCTAssertEqual(Language.objective_cpp.xflag, "objective-c++")
XCTAssertEqual(Language.objective_cpp.xflagHeader, "objective-c++-header")
}
func testURLEscaping() {
let expectedURL = URL(string: "file:///folder/image@3x.png")
let doc = DocumentURI(string: "file:///folder/image%403x.png")
XCTAssertEqual(doc.fileURL, expectedURL)
}
}