Change `os(Linux)` compilation condition to `_runtime(_ObjC)`

This commit is contained in:
Norio Nomura 2019-01-05 18:09:22 +09:00
parent 67274b8f47
commit c25a74ab52
No known key found for this signature in database
GPG Key ID: D4A7318EB7F7138D
5 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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")

View File

@ -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