Skip to content

Commit 311c1c9

Browse files
committed
Remove ContiguousBytes test
1 parent 3feb342 commit 311c1c9

File tree

1 file changed

+0
-46
lines changed

1 file changed

+0
-46
lines changed

Tests/TestingTests/AttachmentTests.swift

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -463,11 +463,6 @@ extension AttachmentTests {
463463
let value = try #require("abc123".data(using: .utf8))
464464
try test(value)
465465
}
466-
467-
@Test func contiguousBytesCollection() throws {
468-
let value = MyContiguousCollectionAttachable(string: "abc123")
469-
try test(value)
470-
}
471466
#endif
472467
}
473468
}
@@ -556,45 +551,4 @@ final class MyCodableAndSecureCodingAttachable: NSObject, Codable, NSSecureCodin
556551
string = (coder.decodeObject(of: NSString.self, forKey: "string") as? String) ?? ""
557552
}
558553
}
559-
560-
561-
struct MyContiguousCollectionAttachable: Collection, ContiguousBytes, Test.Attachable, Sendable {
562-
private var _utf8: String.UTF8View
563-
564-
var string: String {
565-
get {
566-
String(_utf8)
567-
}
568-
set {
569-
_utf8 = newValue.utf8
570-
}
571-
}
572-
573-
init(string: String) {
574-
_utf8 = string.utf8
575-
}
576-
577-
var startIndex: String.UTF8View.Index {
578-
_utf8.startIndex
579-
}
580-
581-
var endIndex: String.UTF8View.Index {
582-
_utf8.endIndex
583-
}
584-
585-
subscript(position: String.UTF8View.Index) -> String.UTF8View.Element {
586-
_utf8[position]
587-
}
588-
589-
func index(after i: String.UTF8View.Index) -> String.UTF8View.Index {
590-
_utf8.index(after: i)
591-
}
592-
593-
func withUnsafeBytes<R>(_ body: (UnsafeRawBufferPointer) throws -> R) rethrows -> R {
594-
let result = try _utf8.withContiguousStorageIfAvailable { buffer in
595-
try body(.init(buffer))
596-
}
597-
return try result ?? Array(_utf8).withUnsafeBytes(body)
598-
}
599-
}
600554
#endif

0 commit comments

Comments
 (0)