Skip to content

Commit 561682b

Browse files
committed
Add test case
1 parent b209316 commit 561682b

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test/IDE/complete_cache.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,20 @@
3939
// Check the individual cache item.
4040
// RUN: %target-swift-ide-test -dump-completion-cache %t.ccp/macros-dot-* | %FileCheck %s -check-prefix=CLANG_QUAL_MACROS_2
4141

42+
// Qualified private with dot.
43+
// RUN: %target-swift-ide-test(mock-sdk: %clang-importer-sdk) -code-completion -source-filename %s -code-completion-token=CLANG_QUAL_STRING -completion-cache-path=%t.ccp > %t.string.ccp1.compl.txt
44+
// RUN: %FileCheck %s -check-prefix=CLANG_QUAL_STRING < %t.string.ccp1.compl.txt
45+
46+
4247
// Ensure the testable import showed up mangled correctly.
4348
// RUN: ls %t.ccp/Darwin-testable*
49+
// RUN: ls %t.ccp/AppKit-private*
4450
// REQUIRES: executable_test
4551

4652
import macros
4753
import ctypes
4854
@testable import Darwin
55+
@_private(sourceFile: "AppKit.swift") import AppKit
4956

5057
// CLANG_CTYPES: Begin completions
5158
// CLANG_CTYPES-DAG: Decl[Struct]/OtherModule[ctypes]/keyword[Foo1, Struct1]: FooStruct1[#FooStruct1#]{{; name=.+$}}
@@ -106,3 +113,10 @@ func testCompleteModuleQualifiedMacros2() {
106113
// CLANG_QUAL_MACROS_2-DAG: Decl[GlobalVar]/OtherModule[macros]: .VERSION_STRING[#String#]{{; name=.+$}}
107114
// CLANG_QUAL_MACROS_2: End completions
108115
}
116+
117+
func testPrivate() {
118+
String.#^CLANG_QUAL_STRING^#
119+
// CLANG_QUAL_STRING: Begin completions
120+
// CLANG_QUAL_STRING: name=someMethod()
121+
// CLANG_QUAL_STRING: End completions
122+
}

test/Inputs/clang-importer-sdk/swift-modules/AppKit.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@
33
extension String {
44
public static func someFactoryMethod() -> Int { return 0 }
55
}
6+
7+
extension String {
8+
static func someMethod() -> Int { return 0 }
9+
}

0 commit comments

Comments
 (0)