@@ -212,6 +212,8 @@ class TestNSData: LoopbackServerTest {
212
212
( " testCopyBytes " , testCopyBytes) ,
213
213
( " testCustomDeallocator " , testCustomDeallocator) ,
214
214
( " testDataInSet " , testDataInSet) ,
215
+ ( " testFirstRangeEmptyData " , testFirstRangeEmptyData) ,
216
+ ( " testLastRangeEmptyData " , testLastRangeEmptyData) ,
215
217
( " testEquality " , testEquality) ,
216
218
( " testGenericAlgorithms " , testGenericAlgorithms) ,
217
219
( " testInitializationWithArray " , testInitializationWithArray) ,
@@ -1194,6 +1196,16 @@ extension TestNSData {
1194
1196
XCTAssertEqual ( s. count, 2 , " Expected only two entries in the Set " )
1195
1197
}
1196
1198
1199
+ func testFirstRangeEmptyData( ) {
1200
+ let d = Data ( [ 1 , 2 , 3 ] )
1201
+ XCTAssertNil ( d. firstRange ( of: Data ( ) ) )
1202
+ }
1203
+
1204
+ func testLastRangeEmptyData( ) {
1205
+ let d = Data ( [ 1 , 2 , 3 ] )
1206
+ XCTAssertNil ( d. lastRange ( of: Data ( ) ) )
1207
+ }
1208
+
1197
1209
func testReplaceSubrange( ) {
1198
1210
var hello = dataFrom ( " Hello " )
1199
1211
let world = dataFrom ( " World " )
0 commit comments