Skip to content

Commit 8aa1627

Browse files
authored
Merge pull request #28740 from rintaro/ide-completion-multifiletest-rawvalue
[CodeCompletion] Test for 'rawValue' completion in multi file scenario
2 parents 1316f57 + fbb0f65 commit 8aa1627

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/IDE/complete_multifile.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=POINT_DOT | %FileCheck --check-prefix=POINT_DOT %s
66
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=LENS_DOT | %FileCheck --check-prefix=LENS_DOT %s
77
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=MYENUM_DOT | %FileCheck --check-prefix=MYENUM_DOT %s
8+
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=MYENUM_INSTANCE_DOT | %FileCheck --check-prefix=MYENUM_INSTANCE_DOT %s
89
// RUN: %target-swift-ide-test -code-completion -source-filename %t/Main.swift %t/Library.swift -code-completion-token=HASWRAPPED_DOT| %FileCheck --check-prefix=HASWRAPPED_DOT %s
910

1011
// BEGIN Library.swift
@@ -84,7 +85,15 @@ func testRawRepresentable() {
8485
// MYENUM_DOT-DAG: Decl[InstanceMethod]/Super: hash({#(self): MyEnum#})[#(into: inout Hasher) -> Void#];
8586
// MYENUM_DOT: End completions
8687
}
87-
88+
func testRawRepesentableInstance(value: MyEnum) {
89+
value.#^MYENUM_INSTANCE_DOT^#
90+
// MYENUM_INSTANCE_DOT: Begin completions, 4 items
91+
// MYENUM_INSTANCE_DOT-DAG: Keyword[self]/CurrNominal: self[#MyEnum#];
92+
// MYENUM_INSTANCE_DOT-DAG: Decl[InstanceVar]/CurrNominal: rawValue[#String#];
93+
// MYENUM_INSTANCE_DOT-DAG: Decl[InstanceVar]/Super: hashValue[#Int#];
94+
// MYENUM_INSTANCE_DOT-DAG: Decl[InstanceMethod]/Super: hash({#into: &Hasher#})[#Void#];
95+
// MYENUM_INSTANCE_DOT: End completions
96+
}
8897
func testHasWrappedValue(value: HasWrapped) {
8998
value.#^HASWRAPPED_DOT^#
9099
// HASWRAPPED_DOT: Begin completions, 3 items

0 commit comments

Comments
 (0)