Skip to content

Commit 52ce15e

Browse files
committed
Gardening: Migrate test suite to GH issues: stdlib
1 parent a8b83b4 commit 52ce15e

26 files changed

+82
-61
lines changed

test/stdlib/ArrayBridge.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ tests.test("rdar://problem/27905230") {
485485
}
486486

487487
tests.test("verbatimBridged/Base/withUnsafeBufferPointer") {
488-
// https://bugs.swift.org/browse/SR-14663
488+
// https://github.com/apple/swift/issues/57014
489489
// This tests a bad precondition that was fixed in
490490
// https://github.com/apple/swift/pull/37960
491491
guard #available(SwiftStdlib 5.5, *) else { return }
@@ -504,7 +504,7 @@ tests.test("verbatimBridged/Base/withUnsafeBufferPointer") {
504504
}
505505

506506
tests.test("verbatimBridged/AnyObject/withUnsafeBufferPointer") {
507-
// https://bugs.swift.org/browse/SR-14663
507+
// https://github.com/apple/swift/issues/57014
508508
// This tests a bad precondition that was fixed in
509509
// https://github.com/apple/swift/pull/37960
510510
guard #available(SwiftStdlib 5.5, *) else { return }

test/stdlib/Bundle.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ BundleTests.test("Bundle.bundleForNilClass") {
1212
// Foundation implementation does. The patched version from
1313
// ObjCRuntimeGetImageNameFromClass did not.
1414
//
15-
// SR-9188
15+
// https://github.com/apple/swift/issues/51679
16+
1617
typealias BundleForClassFunc =
1718
@convention(c) (AnyObject, Selector, AnyObject?) -> Bundle
1819

test/stdlib/ErrorBridged.swift

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ func conditionalCast<T>(_ x: Any, to: T.Type) -> T? {
698698
return x as? T
699699
}
700700

701-
// SR-1562
701+
// https://github.com/apple/swift/issues/44171
702702
ErrorBridgingTests.test("Error archetype identity") {
703703
let myError = NSError(domain: "myErrorDomain", code: 0,
704704
userInfo: [ "one" : 1 ])
@@ -723,7 +723,8 @@ ErrorBridgingTests.test("Error archetype identity") {
723723
=== nsError)
724724
}
725725

726-
// SR-9389
726+
// https://github.com/apple/swift/issues/51855
727+
727728
class ParentA: NSObject {
728729
@objc(ParentAError) enum Error: Int, Swift.Error {
729730
case failed
@@ -794,7 +795,8 @@ ErrorBridgingTests.test("error-to-NSObject casts") {
794795
}
795796
}
796797

797-
// SR-7732: Casting CFError or NSError to Error results in a memory leak
798+
// https://github.com/apple/swift-corelibs-foundation/issues/3701
799+
// Casting 'CFError' or 'NSError' to 'Error' results in a memory leak
798800
ErrorBridgingTests.test("NSError-to-Error casts") {
799801
func should_not_leak_nserror() {
800802
let something: Any? = NSError(domain: "Foo", code: 1)
@@ -821,11 +823,13 @@ ErrorBridgingTests.test("CFError-to-Error casts") {
821823
}
822824
}
823825

826+
// https://github.com/apple/swift/issues/51697
827+
824828
enum MyError: Error {
825829
case someThing
826830
}
827831

828-
ErrorBridgingTests.test("SR-9207 crash in failed cast to NSError") {
832+
ErrorBridgingTests.test("Crash in failed cast to 'NSError'") {
829833

830834
if #available(SwiftStdlib 5.2, *) {
831835
let error = MyError.someThing
@@ -837,7 +841,7 @@ ErrorBridgingTests.test("SR-9207 crash in failed cast to NSError") {
837841
}
838842
}
839843

840-
// SR-7652
844+
// https://github.com/apple/swift/issues/50193
841845

842846
enum SwiftError: Error, CustomStringConvertible {
843847
case something

test/stdlib/ImplicitlyUnwrappedOptional.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ ImplicitlyUnwrappedOptionalTests.test("preferOptional") {
6767
let j: Int = 1
6868
if i != j {} // we should choose != for Optionals rather than forcing i
6969
if i == j {} // we should choose == for Optionals rather than forcing i
70-
// FIXME: https://bugs.swift.org/browse/SR-6988
70+
// FIXME: https://github.com/apple/swift/issues/49536
7171
// if i *^* j {} // we should choose *^* for Optionals rather than forcing i
7272
}
7373

test/stdlib/IntegerCompatibility.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,14 @@ func negativeShift(_ u8: UInt8) {
4848
_ = (u8 << -1)
4949
}
5050

51-
func sr5176(description: String = "unambiguous Int32.init(bitPattern:)") {
51+
// https://github.com/apple/swift/issues/47752
52+
// Ambiguous 'Int32.init(bitPattern:)'
53+
do {
5254
_ = Int32(bitPattern: 0) // should compile without ambiguity
5355
}
5456

55-
func sr6634(x: UnsafeBufferPointer<UInt8>) -> Int {
57+
// https://github.com/apple/swift/issues/49183
58+
func f_49183(x: UnsafeBufferPointer<UInt8>) -> Int {
5659
return x.lazy.filter { $0 > 127 || $0 == 0 }.count // should be unambiguous
5760
}
5861

test/stdlib/Integers.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ tests.test("Remainder/DividingBy0") {
776776
}
777777

778778
tests.test("RemainderReportingOverflow/DividingByMinusOne") {
779-
// Work around SR-5964.
779+
// Work around https://github.com/apple/swift/issues/48523.
780780
func minusOne<T : SignedInteger>() -> T {
781781
return -1 as T
782782
}
@@ -844,7 +844,7 @@ tests.test("Strideable") {
844844
expectEqual(dist(${u}Int.max, ${u}x), -10)
845845

846846
// FIXME: The compiler spuriously flags these as overflowing:
847-
// https://bugs.swift.org/browse/SR-5882
847+
// https://github.com/apple/swift/issues/48452
848848
// expectEqual(${u}x.distance(to: ${u}Int.max), 10)
849849
% end
850850

test/stdlib/KVOKeyPaths.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77

88
// REQUIRES: objc_interop
99

10-
// SR-9838 Disable because it blocks PR testing.
10+
// FIXME: https://github.com/apple/swift/issues/52252
11+
// Disable because it blocks PR testing.
1112
// UNSUPPORTED: CPU=i386
1213

1314
import Foundation

test/stdlib/KeyPath.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -986,24 +986,24 @@ keyPath.test("key path literal closures") {
986986
expectEqual(3, variadicFn("a", "b", "c"))
987987
}
988988

989-
// SR-6096
989+
// https://github.com/apple/swift/issues/48651
990990

991-
protocol Protocol6096 {}
992-
struct Value6096<ValueType> {}
993-
extension Protocol6096 {
991+
protocol P_48651 {}
992+
struct S_48651<ValueType> {}
993+
extension P_48651 {
994994
var asString: String? {
995995
return self as? String
996996
}
997997
}
998-
extension Value6096 where ValueType: Protocol6096 {
998+
extension S_48651 where ValueType: P_48651 {
999999
func doSomething() {
10001000
_ = \ValueType.asString?.endIndex
10011001
}
10021002
}
1003-
extension Int: Protocol6096 {}
1003+
extension Int: P_48651 {}
10041004

10051005
keyPath.test("optional chaining component that needs generic instantiation") {
1006-
Value6096<Int>().doSomething()
1006+
S_48651<Int>().doSomething()
10071007
}
10081008

10091009
// Nested generics.

test/stdlib/Mirror.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,9 @@ func verifyWeakUnownedReflection
589589
verifyExistentialField(child: i.next()!, name: "unowned_unsafe_existential")
590590
expectNil(i.next())
591591

592-
// The original bug report from SR-5289 crashed when the print() code
593-
// attempted to reflect the contents of an unowned field.
592+
// The original bug report from https://github.com/apple/swift/issues/47864
593+
// crashed when the print() code attempted to reflect the contents of an
594+
// unowned field.
594595
// The tests above _should_ suffice to check this, but let's print everything
595596
// anyway just to be sure.
596597
for c in m.children {
@@ -599,9 +600,10 @@ func verifyWeakUnownedReflection
599600
}
600601

601602
#if _runtime(_ObjC)
602-
// Related: SR-5289 reported a crash when using Mirror to inspect Swift
603-
// class objects containing unowned pointers to Obj-C class objects.
604-
mirrors.test("Weak and Unowned Obj-C refs in class (SR-5289)") {
603+
// Related: https://github.com/apple/swift/issues/47864 reported a crash when
604+
// using 'Mirror' to inspect Swift class objects containing unowned pointers
605+
// to Obj-C class objects.
606+
mirrors.test("Weak and Unowned Obj-C refs in class") {
605607
class SwiftClassWithWeakAndUnowned {
606608
var strong_class: WeakUnownedObjCClass
607609
var strong_existential: WeakUnownedTestsP1 & WeakUnownedTestsP2

test/stdlib/Optional.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,14 @@ OptionalTests.test("Casting Optional") {
305305
expectTrue(anyToAny(x, Optional<Optional<C>>.self)!! === x)
306306
expectTrue(anyToAnyOrNil(ni, Int.self) == nil)
307307

308-
// Test for SR-459: Weakened optionals don't zero.
308+
// https://github.com/apple/swift/issues/43076
309+
// Weakened optionals don't zero
309310
var t = LifetimeTracked(0)
310311
_ = anyToAny(Optional(t), CustomDebugStringConvertible.self)
311312
expectTrue(anyToAnyIs(Optional(t), CustomDebugStringConvertible.self))
312313

313-
// Test for SR-912: Runtime exception casting an Any nil to an Optional.
314+
// https://github.com/apple/swift/issues/43524
315+
// Runtime exception casting an 'Any' nil to an 'Optional'
314316
let oi: Int? = nil
315317
expectTrue(anyToAny(oi as Any, Optional<Int>.self) == nil)
316318
expectTrue(anyToAnyIs(oi as Any, Optional<Int>.self))

0 commit comments

Comments
 (0)