Skip to content

Gardening: Migrate test suite to GH issues p. 15 #60868

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/IDE/coloring_class_restriction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %target-swift-ide-test -syntax-coloring -typecheck -source-filename %s | %FileCheck %s

// NOTE: Testing 'class' at the end of the file. Don't add anything after that.
// https://bugs.swift.org/browse/SR-8378
// https://github.com/apple/swift/issues/50905

// CHECK: <kw>protocol</kw> P : <type>class</type>
protocol P : class
16 changes: 10 additions & 6 deletions test/IDE/complete_call_arg.swift
Original file line number Diff line number Diff line change
Expand Up @@ -930,11 +930,13 @@ func testCompleteLabelAfterVararg() {
// COMPLETE_MEMBER_IN_VARARG: End completions
}

struct Sr14515 {
// https://github.com/apple/swift/issues/56867

struct S_56867 {
func test(_: Foo..., yArg: Baz) {}
}

private func testSr14515(value: Sr14515, foo: Foo, baz: Baz) {
private func test_56867(value: S_56867, foo: Foo, baz: Baz) {
value.test(foo, #^COMPLETE_VARARG_FOLLOWED_BY_NORMAL_ARG^#)
// COMPLETE_VARARG_FOLLOWED_BY_NORMAL_ARG: Begin completions
// COMPLETE_VARARG_FOLLOWED_BY_NORMAL_ARG-DAG: Decl[LocalVar]/Local/TypeRelation[Convertible]: foo[#Foo#];
Expand Down Expand Up @@ -995,15 +997,17 @@ struct Rdar77867723 {
}
}

struct SR14737<T> {
// https://github.com/apple/swift/issues/57087

struct S_57087<T> {
init(arg1: T, arg2: Bool) {}
}
extension SR14737 where T == Int {
extension S_57087 where T == Int {
init(arg1: T, onlyInt: Bool) {}
}
func test_SR14737() {
do {
invalidCallee {
SR14737(arg1: true, #^GENERIC_INIT_IN_INVALID^#)
S_57087(arg1: true, #^GENERIC_INIT_IN_INVALID^#)
// GENERIC_INIT_IN_INVALID: Begin completions, 1 item
// GENERIC_INIT_IN_INVALID-DAG: Pattern/Local/Flair[ArgLabels]: {#arg2: Bool#}[#Bool#];
// GENERIC_INIT_IN_INVALID: End completions
Expand Down
3 changes: 2 additions & 1 deletion test/IDE/complete_constrained.swift
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ func foo(s: MyStruct<Int>) {
// META_MYSTRUCT_INT_DOT: End completions
}

//https://bugs.swift.org/browse/SR-9938
// https://github.com/apple/swift/issues/52344

enum Fruit { case apple }
enum Vegetable { case broccoli }
enum Meat { case chicken }
Expand Down
4 changes: 3 additions & 1 deletion test/IDE/complete_generic_optional.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ struct Foo<T> {
}
}

// SR-642 Code completion does not instantiate generic arguments of a type wrapped in an optional
// https://github.com/apple/swift/issues/43259
// Code completion does not instantiate generic arguments of a type wrapped
// in an optional
let x: Foo<Bar>? = Foo<Bar>()
x.#^FOO_OPTIONAL_1^#
// FOO_OPTIONAL_1: Begin completions, 7 items
Expand Down
19 changes: 11 additions & 8 deletions test/IDE/complete_generic_param.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,30 @@ class C3 {
// INHERIT-NOT: ValueString2
// INHERIT-NOT: TopLevelFunc

// https://github.com/apple/swift/issues/56788

class Sr14432<T, U> {}
class C4<T, U> {}

_ = Sr14432<#^GENERIC_TYPE_PARAM^# >()
_ = Sr14432<SomeType, #^SECOND_GENERIC_TYPE_PARAM^# >()
_ = C4<#^GENERIC_TYPE_PARAM^# >()
_ = C4<SomeType, #^SECOND_GENERIC_TYPE_PARAM^# >()
// GENERIC_TYPE_PARAM: Begin completions
// GENERIC_TYPE_PARAM-DAG: Decl[Class]/CurrModule: C1[#C1#];
// GENERIC_TYPE_PARAM: End completions

struct Sr14627 {
// https://github.com/apple/swift/issues/56979

struct S2 {
struct Nested<Elements> {
init() { fatalError() }
init() {}
}
}

var sr14627_globalVar = Sr14627.Nested< #^GENERIC_PARAM_ON_NESTED_TYPE_GLOBAL_VAR^#>()
var s2_globalVar = S2.Nested< #^GENERIC_PARAM_ON_NESTED_TYPE_GLOBAL_VAR^#>()

func someFunction() {
var sr14627_localVar = Sr14627.Nested< #^GENERIC_PARAM_ON_NESTED_TYPE_LOCAL_VAR^#>()
var s2_localVar = S2.Nested< #^GENERIC_PARAM_ON_NESTED_TYPE_LOCAL_VAR^#>()
}

// GENERIC_PARAM_ON_NESTED_TYPE: Begin completions
// GENERIC_PARAM_ON_NESTED_TYPE-DAG: Decl[Struct]/CurrModule: Sr14627[#Sr14627#];
// GENERIC_PARAM_ON_NESTED_TYPE-DAG: Decl[Struct]/CurrModule: S2[#S2#];
// GENERIC_PARAM_ON_NESTED_TYPE: End completions
3 changes: 2 additions & 1 deletion test/IDE/complete_import_overloads.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

import library

// https://github.com/apple/swift/issues/49889
// Ensure we maintain compatibility with Swift 4's overload signature rules.
// Variables defined in extensions of generic types had different overload
// signatures to other variables, so allow overloading in such cases (SR-7341).
// signatures to other variables, so allow overloading in such cases.
extension HasFooGeneric {
var foo: String { return "" } // foo isn't defined in a generic extension in the other module, so allow overloading in Swift 4 mode.
var bar: String { return "" } // bar is defined in a generic extension in the other module, so `bar: String` always shadows it.
Expand Down
35 changes: 18 additions & 17 deletions test/IDE/complete_member_decls_from_parent_decl_context.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=NESTED_NOMINAL_DECL_E_1 | %FileCheck %s -check-prefix=NESTED_NOMINAL_DECL_E_1

// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=SR627_SUBCLASS | %FileCheck %s -check-prefix=SR627_SUBCLASS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=SR627_SUB_SUBCLASS | %FileCheck %s -check-prefix=SR627_SUB_SUBCLASS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ISSUE_43244_SUBCLASS | %FileCheck %s -check-prefix=ISSUE_43244_SUBCLASS
// RUN: %target-swift-ide-test -code-completion -source-filename %s -code-completion-token=ISSUE_43244_SUB_SUBCLASS | %FileCheck %s -check-prefix=ISSUE_43244_SUB_SUBCLASS

//===---
//===--- Test that we can code complete in methods, and correctly distinguish
Expand Down Expand Up @@ -598,22 +598,23 @@ func testOuterE() {
// NESTED_NOMINAL_DECL_E_1-NOT: dFunc6()
// NESTED_NOMINAL_DECL_E_1: End completions

class SR627_BaseClass<T> {
func myFunction(_ x: T) -> T? {
return nil
// https://github.com/apple/swift/issues/43244
do {
class BaseClass<T> {
func myFunction(_ x: T) -> T? {}
}
}

class SR627_Subclass: SR627_BaseClass<String> {
#^SR627_SUBCLASS^#
// SR627_SUBCLASS: Begin completions
// SR627_SUBCLASS-DAG: Decl[InstanceMethod]/Super: override func myFunction(_ x: String) -> String? {|}; name=myFunction(:)
// SR627_SUBCLASS: End completions
}
class Subclass: BaseClass<String> {
#^ISSUE_43244_SUBCLASS^#
// ISSUE_43244_SUBCLASS: Begin completions
// ISSUE_43244_SUBCLASS-DAG: Decl[InstanceMethod]/Super: override func myFunction(_ x: String) -> String? {|}; name=myFunction(:)
// ISSUE_43244_SUBCLASS: End completions
}

class SR627_SubSubclass: SR627_Subclass {
#^SR627_SUB_SUBCLASS^#
// SR627_SUB_SUBCLASS: Begin completions
// SR627_SUB_SUBCLASS-DAG: Decl[InstanceMethod]/Super: override func myFunction(_ x: String) -> String? {|}; name=myFunction(:)
// SR627_SUB_SUBCLASS: End completions
class SubSubclass: Subclass {
#^ISSUE_43244_SUB_SUBCLASS^#
// ISSUE_43244_SUB_SUBCLASS: Begin completions
// ISSUE_43244_SUB_SUBCLASS-DAG: Decl[InstanceMethod]/Super: override func myFunction(_ x: String) -> String? {|}; name=myFunction(:)
// ISSUE_43244_SUB_SUBCLASS: End completions
}
}
4 changes: 3 additions & 1 deletion test/IDE/complete_multiple_files.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ func moduleScoped() {
// MODULE_SCOPED-NOT: ERROR
// MODULE_SCOPED: End completions

// https://github.com/apple/swift/issues/57800

enum Foo {
case bar
}

var sr15495: Void = {
var _: Void = {
let foo: Foo = .#^VAR_INITIALIZED_BY_CALLING_CLOSURE^#
}()

Expand Down
2 changes: 1 addition & 1 deletion test/IDE/complete_multiple_trailingclosure.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func testFallbackPostfix() {
// doesn't match the already-provided parameters (missing `name` label argument
// and closure does not return `String`). However, we are not type-checking at
// the stage at which we complete argument labels, so we can't rule it out for
// now (SR-14450).
// now. (https://github.com/apple/swift/issues/56806)
// INIT_FALLBACK_1: Begin completions, 3 items
// INIT_FALLBACK_1-DAG: Pattern/Local/Flair[ArgLabels]: {#arg3: () -> _ {|}#}[#() -> _#]
// INIT_FALLBACK_1-DAG: Decl[InstanceMethod]/CurrNominal: .testStructMethod()[#Void#];
Expand Down
19 changes: 11 additions & 8 deletions test/IDE/complete_override.swift
Original file line number Diff line number Diff line change
Expand Up @@ -387,16 +387,18 @@ class OmitKW10: ProtocolA {
// WITH_PA
}

protocol SR2560Proto {
// https://github.com/apple/swift/issues/45165

protocol P_45165 {
func foo<S : Sequence>(x: S) where S.Iterator.Element == Int
}
class SR2560Class: SR2560Proto {
#^SR2560_WHERE_CLAUSE?keywords=false^#
class C_45165: P_45165 {
#^ISSUE_45165_WHERE_CLAUSE?keywords=false^#
}

// SR2560_WHERE_CLAUSE: Begin completions
// SR2560_WHERE_CLAUSE: Decl[InstanceMethod]/Super: func foo<S>(x: S) where S : Sequence, S.Element == Int {|};
// SR2560_WHERE_CLAUSE: End completions
// ISSUE_45165_WHERE_CLAUSE: Begin completions
// ISSUE_45165_WHERE_CLAUSE: Decl[InstanceMethod]/Super: func foo<S>(x: S) where S : Sequence, S.Element == Int {|};
// ISSUE_45165_WHERE_CLAUSE: End completions

protocol HasThrowingProtocol {
func foo() throws
Expand Down Expand Up @@ -758,10 +760,11 @@ class SynthesizedConformance5: SynthesizedConformance2 {
// FIXME: 'required init(from decoder: Decoder)' is suggested twice
}

protocol ProtocolSr14687 {
// https://github.com/apple/swift/issues/57037
protocol P_57037 {
var value: Int { get }
}
struct StructSr14687: ProtocolSr14687 {
struct S_57037: P_57037 {
let foo = val, #^MULTI_VAR_DECL_OVERRIDE^#
// MULTI_VAR_DECL_OVERRIDE: Begin completions, 1 items
// MULTI_VAR_DECL_OVERRIDE-DAG: Decl[InstanceVar]/Super: value: Int;
Expand Down
2 changes: 1 addition & 1 deletion test/IDE/complete_precedencegroup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func testType() {
// PRECEDENCE_GROUP-DAG: Decl[PrecedenceGroup]/OtherModule[Swift]/IsSystem: AssignmentPrecedence; name=AssignmentPrecedence
// PRECEDENCE_GROUP-DAG: Decl[PrecedenceGroup]/OtherModule[Swift]/IsSystem: ComparisonPrecedence; name=ComparisonPrecedence

/* FIXME: SR-8898 We only see precedence groups that are earlier in life! */
/* FIXME: (https://github.com/apple/swift/issues/51404) We only see precedence groups that are earlier in life! */
// PRECEDENCE_GROUP_CURRFILE-DAG: Begin completions
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
// PRECEDENCE_GROUP_CURRFILE-DAG: Decl[PrecedenceGroup]/CurrModule: MyPrecedence{{[0-9]+}};
Expand Down
10 changes: 6 additions & 4 deletions test/IDE/complete_protocol_static_member.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ func test2<T: FontStyle>(x: T) {
// COMPLETE_ON_GENERIC_FUNC: End completions
}

struct Sr12973 {}
// https://github.com/apple/swift/issues/55419

struct Struct {}
struct Indicator<T> {}
extension Indicator where T == Sr12973 {
static var activity: Indicator<Sr12973> { fatalError() }
extension Indicator where T == Struct {
static var activity: Indicator<Struct> { fatalError() }
}

func receiver<T>(_ inidicator: Indicator<T>) {}
Expand All @@ -60,7 +62,7 @@ func test() {
}
// COMPLETE_GENERIC_TYPE: Begin completions, 2 items
// COMPLETE_GENERIC_TYPE: Decl[Constructor]/CurrNominal/TypeRelation[Convertible]: init()[#Indicator<T>#];
// COMPLETE_GENERIC_TYPE: Decl[StaticVar]/CurrNominal/TypeRelation[Convertible]: activity[#Indicator<Sr12973>#];
// COMPLETE_GENERIC_TYPE: Decl[StaticVar]/CurrNominal/TypeRelation[Convertible]: activity[#Indicator<Struct>#];
// COMPLETE_GENERIC_TYPE: End completions

func testRecursive<T>(_ inidicator: Indicator<T>) {
Expand Down
2 changes: 1 addition & 1 deletion test/IDE/complete_sr13271.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// RUN: %swift-ide-test -code-completion -source-filename=%s -code-completion-token=B | %FileCheck %s --check-prefix=B
// RUN: %swift-ide-test -code-completion -source-filename=%s -code-completion-token=D | %FileCheck %s --check-prefix=D

// https://bugs.swift.org/browse/SR-13271
// https://github.com/apple/swift/issues/55711
// https://forums.swift.org/t/code-completion-enhancement-request/38677

enum AIdentifier {
Expand Down
2 changes: 2 additions & 0 deletions test/IDE/complete_sr13574.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=OVERRIDE | %FileCheck %s --check-prefix=OVERRIDE
// RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=MEMBER | %FileCheck %s --check-prefix=MEMBER

// https://github.com/apple/swift/issues/56012

class Root {
func onRoot() {}
}
Expand Down
2 changes: 2 additions & 0 deletions test/IDE/complete_sr14454.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %target-swift-ide-test -batch-code-completion -source-filename %s -filecheck %raw-FileCheck -completion-output-dir %t

// https://github.com/apple/swift/issues/56810

struct Foo {
let bar: Bool
}
Expand Down
2 changes: 2 additions & 0 deletions test/IDE/complete_sr14455.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %swift-ide-test -code-completion -source-filename %s -code-completion-token=COMPLETE | %FileCheck %s

// https://github.com/apple/swift/issues/56811

public enum Endpoint {
  case movieDetail

Expand Down
2 changes: 2 additions & 0 deletions test/IDE/complete_sr14711.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %swift-ide-test --code-completion --source-filename %s --code-completion-token=COMPLETE | %FileCheck %s

// https://github.com/apple/swift/issues/57061

struct TodaySectionEditView {
var sections: [SectionHeaderView2] = []
@ViewBuilder2 var body: some View2 {
Expand Down
2 changes: 2 additions & 0 deletions test/IDE/complete_sr14916.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// RUN: %swift-ide-test -code-completion -code-completion-token COMPLETE -source-filename %s | %FileCheck %s

// https://github.com/apple/swift/issues/57263

struct Foo {
var bar: Int
}
Expand Down
2 changes: 1 addition & 1 deletion test/IDE/complete_user_accessible.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Check that serialized non user accessible functions are not autocompleted.
/// rdar://problem/53891642
/// SR-7460
/// https://github.com/apple/swift/issues/50003

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module %S/Inputs/complete_user_accessibility_helper.swift -module-name helper -emit-module-path %t/helper.swiftmodule
Expand Down
2 changes: 1 addition & 1 deletion test/IDE/print_ast_tc_decls_errors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ typealias Typealias1 = FooNonExistentProtocol // expected-error {{cannot find ty
// NO-TYREPR: {{^}}typealias Typealias1 = <<error type>>{{$}}
// TYREPR: {{^}}typealias Typealias1 = FooNonExistentProtocol{{$}}

// sr-197
// https://github.com/apple/swift/issues/42819
func foo(bar: Typealias1<Int>) {} // Should not generate error "cannot specialize non-generic type '<<error type>>'"

// Associated types.
Expand Down
9 changes: 5 additions & 4 deletions test/IDE/range_info_basics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,17 +149,18 @@ func testDefer() {
}
}

// https://github.com/apple/swift/issues/55404
func testPropertyWrapper() {
@propertyWrapper
public struct SR12958 {
public struct Wrapper {
public var wrappedValue: String
init(_ wrappedValue: String) {
self.wrappedValue = wrappedValue
}
}

public struct MyStruct {
@SR12958("something")
@Wrapper("something")
public static var somevar: String
public static var someothervar: Int
}
Expand Down Expand Up @@ -204,7 +205,7 @@ func testPropertyWrapper() {
// RUN: %target-swift-ide-test -range -pos=133:1 -end-pos=135:65 -source-filename %s | %FileCheck %s -check-prefix=CHECK-NO-PATTERN
// RUN: %target-swift-ide-test -range -pos=142:12 -end-pos=142:17 -source-filename %s | %FileCheck %s -check-prefix=CHECK-X-Y
// RUN: %target-swift-ide-test -range -pos=147:1 -end-pos=150:1 -source-filename %s | %FileCheck %s -check-prefix=CHECK-INVALID
// RUN: %target-swift-ide-test -range -pos=162:5 -end-pos=163:38 -source-filename %s | %FileCheck %s -check-prefix=CHECK-PROPERTY-WRAPPER
// RUN: %target-swift-ide-test -range -pos=163:5 -end-pos=164:38 -source-filename %s | %FileCheck %s -check-prefix=CHECK-PROPERTY-WRAPPER


// CHECK-NO-PATTERN: <Kind>MultiStatement</Kind>
Expand Down Expand Up @@ -504,7 +505,7 @@ func testPropertyWrapper() {
// CHECK-X-Y: <Referenced>y</Referenced><Type>Int</Type>

// CHECK-PROPERTY-WRAPPER: <Kind>SingleDecl</Kind>
// CHECK-PROPERTY-WRAPPER-NEXT: <Content>@SR12958("something")
// CHECK-PROPERTY-WRAPPER-NEXT: <Content>@Wrapper("something")
// CHECK-PROPERTY-WRAPPER-NEXT: public static var somevar: String</Content>
// CHECK-PROPERTY-WRAPPER-NEXT: <Context>swift_ide_test.(file).testPropertyWrapper().MyStruct</Context>
// CHECK-PROPERTY-WRAPPER-NEXT: <Declared>somevar</Declared><OutscopeReference>false</OutscopeReference>
Expand Down
Loading