@@ -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 ( ) }
@@ -270,6 +272,7 @@ CStringTests.test("String.cString.with.Array.CChar.input") {
270
272
}
271
273
272
274
CStringTests . test ( " String.cString.with.String.input " ) {
275
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
273
276
let ( u8p, dealloc) = getASCIIUTF8 ( )
274
277
defer { dealloc ( ) }
275
278
var str = String ( cString: " ab " )
@@ -283,6 +286,7 @@ CStringTests.test("String.cString.with.String.input") {
283
286
}
284
287
285
288
CStringTests . test ( " String.cString.with.inout.UInt8.conversion " ) {
289
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
286
290
var c = UInt8 . zero
287
291
var str = String ( cString: & c)
288
292
expectTrue ( str. isEmpty)
@@ -296,6 +300,7 @@ CStringTests.test("String.cString.with.inout.UInt8.conversion") {
296
300
}
297
301
298
302
CStringTests . test ( " String.cString.with.inout.CChar.conversion " ) {
303
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
299
304
var c = CChar . zero
300
305
var str = String ( cString: & c)
301
306
expectTrue ( str. isEmpty)
@@ -309,6 +314,7 @@ CStringTests.test("String.cString.with.inout.CChar.conversion") {
309
314
}
310
315
311
316
CStringTests . test ( " String.validatingUTF8.with.Array.input " ) {
317
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
312
318
do {
313
319
let ( u8p, dealloc) = getASCIIUTF8 ( )
314
320
defer { dealloc ( ) }
@@ -332,6 +338,7 @@ CStringTests.test("String.validatingUTF8.with.Array.input") {
332
338
}
333
339
334
340
CStringTests . test ( " String.validatingUTF8.with.String.input " ) {
341
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
335
342
let ( u8p, dealloc) = getASCIIUTF8 ( )
336
343
defer { dealloc ( ) }
337
344
var str = String ( validatingUTF8: " ab " )
@@ -347,6 +354,7 @@ CStringTests.test("String.validatingUTF8.with.String.input") {
347
354
}
348
355
349
356
CStringTests . test ( " String.validatingUTF8.with.inout.conversion " ) {
357
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
350
358
var c = CChar . zero
351
359
var str = String ( validatingUTF8: & c)
352
360
expectNotNil ( str)
@@ -361,6 +369,7 @@ CStringTests.test("String.validatingUTF8.with.inout.conversion") {
361
369
}
362
370
363
371
CStringTests . test ( " String.decodeCString.with.Array.input " ) {
372
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
364
373
do {
365
374
let ( u8p, dealloc) = getASCIIUTF8 ( )
366
375
defer { dealloc ( ) }
@@ -385,6 +394,7 @@ CStringTests.test("String.decodeCString.with.Array.input") {
385
394
}
386
395
387
396
CStringTests . test ( " String.decodeCString.with.String.input " ) {
397
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
388
398
let ( u8p, dealloc) = getASCIIUTF8 ( )
389
399
defer { dealloc ( ) }
390
400
var result = String . decodeCString (
@@ -404,6 +414,7 @@ CStringTests.test("String.decodeCString.with.String.input") {
404
414
}
405
415
406
416
CStringTests . test ( " String.decodeCString.with.inout.conversion " ) {
417
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
407
418
var c = Unicode . UTF8. CodeUnit. zero
408
419
var result = String . decodeCString (
409
420
& c, as: Unicode . UTF8. self, repairingInvalidCodeUnits: true
@@ -421,6 +432,7 @@ CStringTests.test("String.decodeCString.with.inout.conversion") {
421
432
}
422
433
423
434
CStringTests . test ( " String.init.decodingCString.with.Array.input " ) {
435
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
424
436
do {
425
437
let ( u8p, dealloc) = getASCIIUTF8 ( )
426
438
defer { dealloc ( ) }
@@ -443,6 +455,7 @@ CStringTests.test("String.init.decodingCString.with.Array.input") {
443
455
}
444
456
445
457
CStringTests . test ( " String.init.decodingCString.with.String.input " ) {
458
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
446
459
let ( u8p, dealloc) = getASCIIUTF8 ( )
447
460
defer { dealloc ( ) }
448
461
var str = String ( decodingCString: " ab " , as: Unicode . UTF8. self)
@@ -456,6 +469,7 @@ CStringTests.test("String.init.decodingCString.with.String.input") {
456
469
}
457
470
458
471
CStringTests . test ( " String.init.decodingCString.with.inout.conversion " ) {
472
+ guard #available( SwiftStdlib 5 . 7 , * ) else { return }
459
473
var c = Unicode . UTF8. CodeUnit. zero
460
474
var str = String ( decodingCString: & c, as: Unicode . UTF8. self)
461
475
expectEqual ( str. isEmpty, true )
0 commit comments