File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ final class JSONLoggerTests : XCTestCase {
6969 XCTAssertEqual ( data. first, 0x0a )
7070 }
7171
72+ #if swift(>=5.7)
7273 func testEncodeMetadataAsJSON( ) throws {
7374 struct BestStruct : Encodable , CustomStringConvertible {
7475 var val : Int
@@ -87,6 +88,7 @@ final class JSONLoggerTests : XCTestCase {
8788 line. date = ref. date
8889 XCTAssertEqual ( line, ref)
8990 }
91+ #endif
9092
9193 func testFallbackOnLogLineEncodeFailure( ) throws {
9294 struct BestStruct : Encodable , CustomStringConvertible {
Original file line number Diff line number Diff line change @@ -5,16 +5,23 @@ import XCTest
55
66
77
8+ let testWhenAvailable1 : [ ( String , ( XCTestCase ) -> ( ) -> Void ) ]
9+ #if swift(>=5.7)
10+ testWhenAvailable1 = [
11+ ( " testEncodeMetadataAsJSON " , JSONLoggerTests . testEncodeMetadataAsJSON) ,
12+ ]
13+ #else
14+ testWhenAvailable1 = [ ]
15+ #endif
816var tests : [ XCTestCaseEntry ] = [
917 testCase ( [
1018 ( " test0NoSeparatorForFirstLog " , JSONLoggerTests . test0NoSeparatorForFirstLog) ,
1119 ( " testFromDoc " , JSONLoggerTests . testFromDoc) ,
1220 ( " testSeparatorForNotFirstLog " , JSONLoggerTests . testSeparatorForNotFirstLog) ,
13- ( " testEncodeMetadataAsJSON " , JSONLoggerTests . testEncodeMetadataAsJSON) ,
1421 ( " testFallbackOnLogLineEncodeFailure " , JSONLoggerTests . testFallbackOnLogLineEncodeFailure) ,
1522 ( " testDecodeLogLineWithBothValidDateAndMangledDate " , JSONLoggerTests . testDecodeLogLineWithBothValidDateAndMangledDate) ,
1623 ( " testDecodeLogLineWithBothInvalidDateAndMangledDate " , JSONLoggerTests . testDecodeLogLineWithBothInvalidDateAndMangledDate) ,
17- ] ) ,
24+ ] + testWhenAvailable1 ) ,
1825]
1926#if !os(WASI)
2027XCTMain ( tests)
You can’t perform that action at this time.
0 commit comments