Skip to content

Commit

Permalink
[Tests] Update failing tests to match new output.
Browse files Browse the repository at this point in the history
  • Loading branch information
Amritpan Kaur committed Oct 3, 2022
1 parent 062930e commit a6478f3
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 51 deletions.
10 changes: 5 additions & 5 deletions test/Concurrency/async_overload_filtering.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ func filter_async(_: String) -> Void {}

var a: String? = nil

// CHECK: attempting disjunction choice $T0 bound to decl async_overload_filtering.(file).filter_async(fn2:)
// CHECK-NEXT: overload set choice binding $T0 := {{.*}}
// CHECK-NEXT: (considering -> ({{.*}}) -> {{.*}} applicable fn {{.*}}
// CHECK: increasing 'sync-in-asynchronous' score by 1
// CHECK: solution is worse than the best solution
// CHECK: Attempting disjunction choice $T0 bound to decl async_overload_filtering.(file).filter_async(fn2:)
// CHECK-NEXT: Overload set choice binding [[A:\$T[0-9]+]] := {{.*}}
// CHECK: `-> Considering -> ({{.*}}) -> {{.*}} applicable fn [[A]]
// CHECK: | `- Increasing 'sync-in-asynchronous' score by 1
// CHECK: | Solution is worse than the best solution
filter_async {
Obj()
}.op("" + (a ?? "a"))
32 changes: 16 additions & 16 deletions test/Constraints/common_type.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@ func f(_: Int) -> X { return X() }
func f(_: Double) -> Y { return Y() }

func testCallCommonType() {
// CHECK: overload set choice binding $T{{[0-9]+}} := (Int) -> X
// CHECK: (considering -> $T{{[0-9]+}}[.g: value] == [[G:\$T[0-9]+]]
// CHECK: (common result type for [[G]] is Int)
// CHECK: (overload set choice binding $T{{[0-9]+}} := (Double) -> Y)
// CHECK: (considering -> $T{{[0-9]+}}[.g: value] == [[F:\$T[0-9]+]]
// CHECK: (common result type for [[F]] is Double)
// CHECK: Overload set choice binding $T{{[0-9]+}} := (Int) -> X
// CHECK: `-> Considering -> $T{{[0-9]+}}[.g: value] == [[G:\$T[0-9]+]]
// CHECK: | Common result type for [[G]] is Int
// CHECK: Overload set choice binding $T{{[0-9]+}} := (Double) -> Y
// CHECK: `-> Considering -> $T{{[0-9]+}}[.g: value] == [[F:\$T[0-9]+]]
// CHECK: | Common result type for [[F]] is Double
_ = f(0).g(0)
}

func testSubscriptCommonType() {
// CHECK: subscript_expr
// CHECK: overload set choice binding $T{{[0-9]+}} := (Int) -> X
// CHECK: (common result type for $T{{[0-9]+}} is String)
// CHECK: (overload set choice binding $T{{[0-9]+}} := (Double) -> Y)
// CHECK: (common result type for $T{{[0-9]+}} is Substring)
// CHECK: Overload set choice binding $T{{[0-9]+}} := (Int) -> X
// CHECK: | Common result type for $T{{[0-9]+}} is String
// CHECK: Overload set choice binding $T{{[0-9]+}} := (Double) -> Y
// CHECK: | Common result type for $T{{[0-9]+}} is Substring
_ = f(0)[0]
}

func testCommonTypeIUO() {
// CHECK: overload set choice binding $T{{[0-9]+}} := (Int) -> X
// CHECK-NOT: common result type
// CHECK: Overload set choice binding $T{{[0-9]+}} := (Int) -> X
// CHECK-NOT: | Common result type
_ = f(0).iuo(0)
}

Expand All @@ -60,10 +60,10 @@ struct Z {
}

func testCommonTypeInit() {
// CHECK: common result type for {{.*}} is Z
// CHECK: | Common result type for {{.*}} is Z
_ = Z(a: 0)

// CHECK-NOT: common result type
// CHECK-NOT: | Common result type
_ = Z(b: 0)
}

Expand All @@ -76,9 +76,9 @@ class InheritsDynamicSelf: DynamicSelf {
}

func testCommonTypeDynamicSelf(ds: DynamicSelf, ids: InheritsDynamicSelf) {
// CHECK: common result type for {{.*}} is DynamicSelf
// CHECK: | Common result type for {{.*}} is DynamicSelf
_ = ds.foo(0)
// CHECK: common result type for {{.*}} is InheritsDynamicSelf
// CHECK: | Common result type for {{.*}} is InheritsDynamicSelf
_ = ids.foo(0)
}

4 changes: 2 additions & 2 deletions test/Constraints/common_type_objc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import Foundation
}

func testOptional(obj: P) {
// CHECK: common result type for {{.*}} is Int
// CHECK: | Common result type for {{.*}} is Int
_ = obj.opt?(1)

// CHECK: common result type for {{.*}} is Int
// CHECK: | Common result type for {{.*}} is Int
_ = obj.opt!(1)
}
28 changes: 14 additions & 14 deletions test/Constraints/one_way_solve.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ func testTernaryOneWayOverload(b: Bool) {
// CHECK: 2: $T{{[0-9]+}} $T{{[0-9]+}} $T{{[0-9]+}}
// CHECK: 0: $T{{[0-9]+}} $T{{[0-9]+}} $T{{[0-9]+}}

// CHECK: solving component #1
// CHECK: (attempting type variable [[C]] := Int8
// CHECK: Solving component #1
// CHECK: Attempting type variable [[C]] := Int8

// CHECK: solving component #1
// CHECK: (attempting type variable [[C]] := Int8
// CHECK: Solving component #1
// CHECK: Attempting type variable [[C]] := Int8

// CHECK: solving component #1
// CHECK: (attempting type variable [[C]] := Int8
// CHECK: Solving component #1
// CHECK: Attempting type variable [[C]] := Int8

// CHECK: solving component #1
// CHECK: (attempting type variable [[C]] := Int8
// CHECK: (considering -> $T{{[0-9]+}} conv [[C]]
// CHECK: (considering -> $T{{[0-9]+}} conv [[C]]
// CHECK: (considering -> [[C]] conv Int8
// CHECK: (found solution: [component: non-default literal(s), value: 2] [component: use of overloaded unapplied function(s), value: 2])
// CHECK: Solving component #1
// CHECK: Attempting type variable [[C]] := Int8
// CHECK: `-> Considering -> [[A]] conv [[C]]
// CHECK: `-> Considering -> [[B]] conv [[C]]
// CHECK: `-> Considering -> [[C]] conv Int8
// CHECK: <! Found solution: [component: non-default literal(s), value: 2] [component: use of overloaded unapplied function(s), value: 2]>

// CHECK: (composed solution: [component: non-default literal(s), value: 2] [component: use of overloaded unapplied function(s), value: 2])
// CHECK-NOT: (composed solution: [component: non-default literal(s), value: 2] [component: use of overloaded unapplied function(s), value: 2])
// CHECK: <! Composed solution: [component: non-default literal(s), value: 2] [component: use of overloaded unapplied function(s), value: 2]>
// CHECK-NOT: <! Composed solution: [component: non-default literal(s), value: 2] [component: use of overloaded unapplied function(s), value: 2]>
let _: Int8 = b ? Builtin.one_way(int8Or16(17)) : Builtin.one_way(int8Or16(42))
}
28 changes: 14 additions & 14 deletions test/Constraints/overload_filtering.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ func foo(_: Int, _: Int) { }
func foo(_: Int, _: Int, _: Int) { }

func testModuleScope(i: Int) {
// CHECK: (disabled disjunction term {{.*}} (Int) -> ()
// CHECK-NEXT: (disabled disjunction term {{.*}} (Int, Int, Int) -> ()
// CHECK: (introducing single enabled disjunction term {{.*}} (Int, Int) -> ()
// CHECK: | Disabled disjunction term {{.*}} (Int) -> ()
// CHECK-NEXT: | Disabled disjunction term {{.*}} (Int, Int, Int) -> ()
// CHECK: | Introducing single enabled disjunction term {{.*}} (Int, Int) -> ()
foo(i, i)
}

Expand All @@ -26,20 +26,20 @@ struct X {
}

func testSubscript(x: X, i: Int) {
// CHECK: disabled disjunction term {{.*}}X.subscript(_:)
// CHECK-NEXT: disabled disjunction term {{.*}}X.subscript(_:_:_:)
// CHECK-NEXT: introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.subscript(_:_:)
// CHECK: | Disabled disjunction term {{.*}}X.subscript(_:)
// CHECK-NEXT: | Disabled disjunction term {{.*}}X.subscript(_:_:_:)
// CHECK-NEXT: | Introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.subscript(_:_:)
_ = x[i, i]
}

func testUnresolvedMember(i: Int) -> X {
// CHECK: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:)
// CHECK-NEXT: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:_:_:)
// CHECK-NEXT: (removed constraint: disjunction
// CHECK: | Disabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:)
// CHECK-NEXT: | Disabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:_:_:)
// CHECK-NEXT: | `- Removed constraint: disjunction
// CHECK-NEXT: > [[A:\$T[0-9]+]] bound to decl overload_filtering
// CHECK-NEXT: > [disabled] [[A]] bound to decl overload_filtering
// CHECK-NEXT: > [disabled] [[A]] bound to decl overload_filtering
// CHECK-NEXT: introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:_:)
// CHECK-NEXT: | Introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).X.init(_:_:)
return .init(i, i)
}

Expand All @@ -58,13 +58,13 @@ func test_member_filtering() {
}

func test(s: S) {
// CHECK: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar(v:)
// CHECK-NEXT: disabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar(a:b:)
// CHECK-NEXT: (removed constraint: disjunction
// CHECK: | Disabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar(v:)
// CHECK-NEXT: | Disabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar(a:b:)
// CHECK-NEXT: `- Removed constraint: disjunction
// CHECK-NEXT: > [[B:\$T[0-9]+]] bound to decl overload_filtering
// CHECK-NEXT: > [disabled] [[B]] bound to decl overload_filtering
// CHECK-NEXT: > [disabled] [[B]] bound to decl overload_filtering
// CHECK-NEXT: introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar
// CHECK-NEXT: | Introducing single enabled disjunction term {{.*}} bound to decl overload_filtering.(file).test_member_filtering().S.bar
s.foo(42).bar(42)
}
}

0 comments on commit a6478f3

Please sign in to comment.