Change `os(Linux)` compilation condition to `_runtime(_ObjC)`
This commit is contained in:
parent
67274b8f47
commit
c25a74ab52
|
@ -99,7 +99,7 @@ extension Date: ScalarRepresentable {
|
|||
private var iso8601String: String {
|
||||
let calendar = Calendar(identifier: .gregorian)
|
||||
let nanosecond = calendar.component(.nanosecond, from: self)
|
||||
#if os(Linux)
|
||||
#if !_runtime(_ObjC)
|
||||
// swift-corelibs-foundation has bug with nanosecond.
|
||||
// https://bugs.swift.org/browse/SR-3158
|
||||
return iso8601Formatter.string(from: self)
|
||||
|
|
|
@ -16,7 +16,7 @@ extension Sequence {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if os(Linux) && !swift(>=4.2)
|
||||
#if !_runtime(_ObjC) && !swift(>=4.2)
|
||||
extension Substring {
|
||||
func hasPrefix(_ prefix: String) -> Bool {
|
||||
return String(self).hasPrefix(prefix)
|
||||
|
|
|
@ -463,7 +463,7 @@ class ConstructorTests: XCTestCase { // swiftlint:disable:this type_body_length
|
|||
}
|
||||
|
||||
func testTimestampWithNanosecond() throws {
|
||||
#if os(Linux)
|
||||
#if !_runtime(_ObjC)
|
||||
// FIXME: swift-corelibs-foundation can't format date with nanosecond.
|
||||
// https://bugs.swift.org/browse/SR-3158
|
||||
#else
|
||||
|
|
|
@ -119,7 +119,7 @@ class EncoderTests: XCTestCase { // swiftlint:disable:this type_body_length
|
|||
|
||||
// MARK: - Date Strategy Tests
|
||||
func testEncodingDate() {
|
||||
#if os(Linux)
|
||||
#if !_runtime(_ObjC)
|
||||
print("Decoding 'Date' has issue on Linux with nanoseconds. https://bugs.swift.org/browse/SR-6223")
|
||||
#else
|
||||
_testRoundTrip(of: Date())
|
||||
|
@ -127,7 +127,7 @@ class EncoderTests: XCTestCase { // swiftlint:disable:this type_body_length
|
|||
}
|
||||
|
||||
func testEncodingDateMillisecondsSince1970() {
|
||||
#if os(Linux)
|
||||
#if !_runtime(_ObjC)
|
||||
print("Decoding 'Date' has issue on Linux with nanoseconds. https://bugs.swift.org/browse/SR-6223")
|
||||
#else
|
||||
_testRoundTrip(of: Date(timeIntervalSince1970: 1000.0), expectedYAML: "1970-01-01T00:16:40Z\n")
|
||||
|
|
|
@ -33,7 +33,7 @@ class RepresenterTests: XCTestCase {
|
|||
XCTAssertEqual(try Node(date), "2001-12-15T02:59:43Z")
|
||||
}
|
||||
do { // fractional seconds
|
||||
#if os(Linux)
|
||||
#if !_runtime(_ObjC)
|
||||
// FIXME: swift-corelibs-foundation can't format date with nanosecond.
|
||||
// https://bugs.swift.org/browse/SR-3158
|
||||
#else
|
||||
|
|
Loading…
Reference in New Issue