@@ -226,6 +226,7 @@ CStringTests.test("Substring.withCString") {
226
226
}
227
227
228
228
CStringTests . test ( " String.cString.with.Array.UInt8.input " ) {
229
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
229
230
do {
230
231
let ( u8p, dealloc) = getASCIIUTF8 ( )
231
232
defer { dealloc ( ) }
@@ -248,6 +249,7 @@ CStringTests.test("String.cString.with.Array.UInt8.input") {
248
249
}
249
250
250
251
CStringTests . test ( " String.cString.with.Array.CChar.input " ) {
252
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
251
253
do {
252
254
let ( u8p, dealloc) = getASCIIUTF8 ( )
253
255
defer { dealloc ( ) }
@@ -271,6 +273,7 @@ CStringTests.test("String.cString.with.Array.CChar.input") {
271
273
}
272
274
273
275
CStringTests . test ( " String.cString.with.String.input " ) {
276
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
274
277
let ( u8p, dealloc) = getASCIIUTF8 ( )
275
278
defer { dealloc ( ) }
276
279
var str = String ( cString: " ab " )
@@ -284,6 +287,7 @@ CStringTests.test("String.cString.with.String.input") {
284
287
}
285
288
286
289
CStringTests . test ( " String.cString.with.inout.UInt8.conversion " ) {
290
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
287
291
var c = UInt8 . zero
288
292
var str = String ( cString: & c)
289
293
expectTrue ( str. isEmpty)
@@ -297,6 +301,7 @@ CStringTests.test("String.cString.with.inout.UInt8.conversion") {
297
301
}
298
302
299
303
CStringTests . test ( " String.cString.with.inout.CChar.conversion " ) {
304
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
300
305
var c = CChar . zero
301
306
var str = String ( cString: & c)
302
307
expectTrue ( str. isEmpty)
@@ -310,6 +315,7 @@ CStringTests.test("String.cString.with.inout.CChar.conversion") {
310
315
}
311
316
312
317
CStringTests . test ( " String.validatingUTF8.with.Array.input " ) {
318
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
313
319
do {
314
320
let ( u8p, dealloc) = getASCIIUTF8 ( )
315
321
defer { dealloc ( ) }
@@ -334,6 +340,7 @@ CStringTests.test("String.validatingUTF8.with.Array.input") {
334
340
}
335
341
336
342
CStringTests . test ( " String.validatingUTF8.with.String.input " ) {
343
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
337
344
let ( u8p, dealloc) = getASCIIUTF8 ( )
338
345
defer { dealloc ( ) }
339
346
var str = String ( validatingUTF8: " ab " )
@@ -349,6 +356,7 @@ CStringTests.test("String.validatingUTF8.with.String.input") {
349
356
}
350
357
351
358
CStringTests . test ( " String.validatingUTF8.with.inout.conversion " ) {
359
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
352
360
var c = CChar . zero
353
361
var str = String ( validatingUTF8: & c)
354
362
expectNotNil ( str)
@@ -363,6 +371,7 @@ CStringTests.test("String.validatingUTF8.with.inout.conversion") {
363
371
}
364
372
365
373
CStringTests . test ( " String.decodeCString.with.Array.input " ) {
374
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
366
375
do {
367
376
let ( u8p, dealloc) = getASCIIUTF8 ( )
368
377
defer { dealloc ( ) }
@@ -388,6 +397,7 @@ CStringTests.test("String.decodeCString.with.Array.input") {
388
397
}
389
398
390
399
CStringTests . test ( " String.decodeCString.with.String.input " ) {
400
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
391
401
let ( u8p, dealloc) = getASCIIUTF8 ( )
392
402
defer { dealloc ( ) }
393
403
var result = String . decodeCString (
@@ -407,6 +417,7 @@ CStringTests.test("String.decodeCString.with.String.input") {
407
417
}
408
418
409
419
CStringTests . test ( " String.decodeCString.with.inout.conversion " ) {
420
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
410
421
var c = Unicode . UTF8. CodeUnit. zero
411
422
var result = String . decodeCString (
412
423
& c, as: Unicode . UTF8. self, repairingInvalidCodeUnits: true
@@ -424,6 +435,7 @@ CStringTests.test("String.decodeCString.with.inout.conversion") {
424
435
}
425
436
426
437
CStringTests . test ( " String.init.decodingCString.with.Array.input " ) {
438
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
427
439
do {
428
440
let ( u8p, dealloc) = getASCIIUTF8 ( )
429
441
defer { dealloc ( ) }
@@ -447,6 +459,7 @@ CStringTests.test("String.init.decodingCString.with.Array.input") {
447
459
}
448
460
449
461
CStringTests . test ( " String.init.decodingCString.with.String.input " ) {
462
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
450
463
let ( u8p, dealloc) = getASCIIUTF8 ( )
451
464
defer { dealloc ( ) }
452
465
var str = String ( decodingCString: " ab " , as: Unicode . UTF8. self)
@@ -460,6 +473,7 @@ CStringTests.test("String.init.decodingCString.with.String.input") {
460
473
}
461
474
462
475
CStringTests . test ( " String.init.decodingCString.with.inout.conversion " ) {
476
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
463
477
var c = Unicode . UTF8. CodeUnit. zero
464
478
var str = String ( decodingCString: & c, as: Unicode . UTF8. self)
465
479
expectEqual ( str. isEmpty, true )
0 commit comments