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))

test/stdlib/PrintFloat.swift.gyb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,8 +768,9 @@ PrintTests.test("Printable_Float") {
768768
// Second-worst case for shortness:
769769
expectDescription("7.038531e-26", Float("7.038531e-26")!)
770770
// Note: The above test computes the reference value from a
771-
// string because `7.038531e-26 as Float` is broken:
772-
// See https://bugs.swift.org/browse/SR-7124
771+
// string because `7.038531e-26 as Float` is broken.
772+
//
773+
// See https://github.com/apple/swift/issues/49672.
773774

774775
// NaNs require special care in testing:
775776
// NaN is printed with additional detail to debugDescription, but not description

test/stdlib/RawRepresentable-tricky-hashing.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ suite.test("_rawHashValue forwarding") {
7474
// RawRepresentable types. Adding a custom hash(into:) implementation should
7575
// always be enough to customize hashing.
7676
//
77-
// See https://bugs.swift.org/browse/SR-10734
77+
// See https://github.com/apple/swift/issues/53126.
7878

7979
if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *) {
8080
let r = CustomRawRepresentable(rawValue: 42)!

test/stdlib/Runtime.swift.gyb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,10 @@ Reflection.test("ObjectIdentifier/CustomDebugStringConvertible") {
673673
class C: Q1 & Codable { }
674674

675675
Reflection.test("multiprotocolTypes") {
676-
// [SR-8158]: Printing type(of: Codable & Protocol type ) EXC_BAD_ACCESS
676+
// https://github.com/apple/swift/issues/50690
677+
// EXC_BAD_ACCESS when calling 'type(of:)' on protocol composition with
678+
// 'Codable'
679+
//
677680
// This use of String(reflecting:) exercises a previously incorrect cast in
678681
// NonFixedExistentialMetatypeBox::Container::getNumWitnessTables.
679682
let obj: Q1 & Codable = C()

test/stdlib/RuntimeObjC.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ ObjCConformsToProtocolTestSuite.test("cast/metatype") {
790790
expectTrue(SomeSubclass.self is SomeObjCProto.Type)
791791
}
792792

793-
// SR-7357
793+
// https://github.com/apple/swift/issues/49905
794794

795795
extension Optional where Wrapped == NSData {
796796
private class Inner {

test/stdlib/SIMD.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ SIMDCodableTests.test("roundTrip") {
7878
/* Apparently these fail to round trip not only for i386 but also on older
7979
macOS versions, so we'll disable them entirely for now.
8080
#if !arch(i386)
81-
// https://bugs.swift.org/browse/SR-9759
81+
// https://github.com/apple/swift-corelibs-foundation/issues/3548
8282
testRoundTrip(SIMD2<Float>.self)
8383
testRoundTrip(SIMD3<Float>.self)
8484
testRoundTrip(SIMD4<Float>.self)

test/stdlib/Strideable.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,8 @@ StrideTestSuite.test("FloatingPointStride/rounding error") {
210210
// multiply-add operation `(1 as Float).addingProduct(0.9, 6)` gives the
211211
// result `6.3999996`. This is nonetheless the desired behavior because
212212
// avoiding error accumulation and intermediate rounding error wherever
213-
// possible will produce better results more often than not (see SR-6377).
213+
// possible will produce better results more often than not (see
214+
// https://github.com/apple/swift/issues/48927).
214215
//
215216
// If checking of end bounds has been inadvertently modified such that we're
216217
// computing the distance from the penultimate element to the end (in this

test/stdlib/StringAPI.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,8 +364,10 @@ StringTests.test("[String].joined() -> String") {
364364
}
365365

366366
StringTests.test("UnicodeScalarView.Iterator.Lifetime") {
367-
// Tests that String.UnicodeScalarView.Iterator is maintaining the lifetime of
368-
// an underlying String buffer. https://bugs.swift.org/browse/SR-5401
367+
// https://github.com/apple/swift/issues/47975
368+
//
369+
// Tests that 'String.UnicodeScalarView.Iterator' is maintaining the lifetime
370+
// of an underlying 'String' buffer.
369371
//
370372
// WARNING: it is very easy to write this test so it produces false negatives
371373
// (i.e. passes even when the code is broken). The array, for example, seems

test/stdlib/StringAPICString.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ CStringTests.test("String.cString.with.Array.UInt8.input") {
241241
}
242242
// no need to test every case; that is covered in other tests
243243
expectCrashLater(
244-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
244+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
245245
// withMessage: "input of String.init(cString:) must be null-terminated"
246246
)
247247
_ = String(cString: [] as [UInt8])
@@ -265,7 +265,7 @@ CStringTests.test("String.cString.with.Array.CChar.input") {
265265
}
266266
// no need to test every case; that is covered in other tests
267267
expectCrashLater(
268-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
268+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
269269
// withMessage: "input of String.init(cString:) must be null-terminated"
270270
)
271271
_ = String(cString: [] as [CChar])
@@ -293,7 +293,7 @@ CStringTests.test("String.cString.with.inout.UInt8.conversion") {
293293
expectTrue(str.isEmpty)
294294
c = 100
295295
expectCrashLater(
296-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
296+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
297297
// withMessage: "input of String.init(cString:) must be null-terminated"
298298
)
299299
str = String(cString: &c)
@@ -307,7 +307,7 @@ CStringTests.test("String.cString.with.inout.CChar.conversion") {
307307
expectTrue(str.isEmpty)
308308
c = 100
309309
expectCrashLater(
310-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
310+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
311311
// withMessage: "input of String.init(cString:) must be null-terminated"
312312
)
313313
str = String(cString: &c)
@@ -332,7 +332,7 @@ CStringTests.test("String.validatingUTF8.with.Array.input") {
332332
}
333333
// no need to test every case; that is covered in other tests
334334
expectCrashLater(
335-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
335+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
336336
// withMessage: "input of String.init(validatingUTF8:) must be null-terminated"
337337
)
338338
_ = String(validatingUTF8: [])
@@ -363,7 +363,7 @@ CStringTests.test("String.validatingUTF8.with.inout.conversion") {
363363
expectEqual(str?.isEmpty, true)
364364
c = 100
365365
expectCrashLater(
366-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
366+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
367367
// withMessage: "input of String.init(validatingUTF8:) must be null-terminated"
368368
)
369369
str = String(validatingUTF8: &c)
@@ -389,7 +389,7 @@ CStringTests.test("String.decodeCString.with.Array.input") {
389389
}
390390
// no need to test every case; that is covered in other tests
391391
expectCrashLater(
392-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
392+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
393393
// withMessage: "input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated"
394394
)
395395
_ = String.decodeCString([], as: Unicode.UTF8.self)
@@ -427,7 +427,7 @@ CStringTests.test("String.decodeCString.with.inout.conversion") {
427427
expectEqual(result?.repairsMade, false)
428428
c = 100
429429
expectCrashLater(
430-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
430+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
431431
// withMessage: "input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated"
432432
)
433433
result = String.decodeCString(&c, as: Unicode.UTF8.self)
@@ -451,7 +451,7 @@ CStringTests.test("String.init.decodingCString.with.Array.input") {
451451
}
452452
// no need to test every case; that is covered in other tests
453453
expectCrashLater(
454-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
454+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
455455
// withMessage: "input of decodeCString(_:as:repairingInvalidCodeUnits:) must be null-terminated"
456456
)
457457
_ = String(decodingCString: [], as: Unicode.UTF8.self)
@@ -479,7 +479,7 @@ CStringTests.test("String.init.decodingCString.with.inout.conversion") {
479479
expectEqual(str.isEmpty, true)
480480
c = 100
481481
expectCrashLater(
482-
// Workaround for https://bugs.swift.org/browse/SR-16103 (rdar://91365967)
482+
// Workaround for https://github.com/apple/swift/issues/58362 (rdar://91365967)
483483
// withMessage: "input of String.init(decodingCString:as:) must be null-terminated"
484484
)
485485
str = String(decodingCString: &c, as: Unicode.UTF8.self)

test/stdlib/StringBridge.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ StringBridgeTests.test("Tagged NSString") {
4040
expectCocoa(bigBs)
4141
expectCocoa(bigQs)
4242

43-
#if false // TODO(SR-7594): re-enable
43+
#if false // FIXME: Re-enable (https://github.com/apple/swift/issues/50136)
4444
let littleAsNSString = ("aa" as NSString)
4545
var littleAs = littleAsNSString as String
4646

test/stdlib/StringCreate.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ StringCreateTests.test("String(decoding:as:)") {
4040
validateDecodingAs(simpleString.rawValue)
4141
}
4242

43-
// Corner-case: UBP with null pointer (https://bugs.swift.org/browse/SR-9869)
43+
// https://github.com/apple/swift/issues/52275
44+
// Corner-case: UBP with null pointer.
4445
expectEqual(
4546
"", String(decoding: UnsafeBufferPointer(_empty: ()), as: UTF8.self))
4647
expectEqual(

0 commit comments

Comments
 (0)