From cf25a8e06cbdc585435dfbeb8cab84a7114049ec Mon Sep 17 00:00:00 2001 From: Alsey Coleman Miller Date: Sat, 24 Sep 2016 16:41:52 -0500 Subject: [PATCH] Fixing unit tests for Linux WIP --- Tests/LinuxMain.swift | 1 + Tests/UnitTests/DataTests.swift | 2 +- Tests/UnitTests/DateComponentsTest.swift | 6 +++++- Tests/UnitTests/JSONTests.swift | 6 +++++- Tests/UnitTests/POSIXTimeTests.swift | 2 +- Tests/UnitTests/RangeTests.swift | 8 ++++++-- Tests/UnitTests/RegularExpressionTests.swift | 18 +++++------------- Tests/UnitTests/StringTests.swift | 5 +++++ Tests/UnitTests/UUIDTests.swift | 7 +++++-- 9 files changed, 34 insertions(+), 21 deletions(-) mode change 100644 => 100755 Tests/LinuxMain.swift mode change 100644 => 100755 Tests/UnitTests/DataTests.swift mode change 100644 => 100755 Tests/UnitTests/DateComponentsTest.swift mode change 100644 => 100755 Tests/UnitTests/POSIXTimeTests.swift mode change 100644 => 100755 Tests/UnitTests/RangeTests.swift mode change 100644 => 100755 Tests/UnitTests/RegularExpressionTests.swift mode change 100644 => 100755 Tests/UnitTests/StringTests.swift mode change 100644 => 100755 Tests/UnitTests/UUIDTests.swift diff --git a/Tests/LinuxMain.swift b/Tests/LinuxMain.swift old mode 100644 new mode 100755 index 32a7286..4cd8dd2 --- a/Tests/LinuxMain.swift +++ b/Tests/LinuxMain.swift @@ -7,6 +7,7 @@ // import XCTest +@testable import UnitTests #if os(OSX) || os(iOS) || os(watchOS) || os(tvOS) func XCTMain(_ testCases: [XCTestCaseEntry]) { fatalError("Not Implemented. Linux only") } diff --git a/Tests/UnitTests/DataTests.swift b/Tests/UnitTests/DataTests.swift old mode 100644 new mode 100755 index 6094aad..db1a9a9 --- a/Tests/UnitTests/DataTests.swift +++ b/Tests/UnitTests/DataTests.swift @@ -11,7 +11,7 @@ #endif import XCTest -import SwiftFoundation +@testable import SwiftFoundation final class DataTests: XCTestCase { diff --git a/Tests/UnitTests/DateComponentsTest.swift b/Tests/UnitTests/DateComponentsTest.swift old mode 100644 new mode 100755 index cec3c78..6f07350 --- a/Tests/UnitTests/DateComponentsTest.swift +++ b/Tests/UnitTests/DateComponentsTest.swift @@ -6,8 +6,12 @@ // Copyright © 2015 PureSwift. All rights reserved. // +#if os(Linux) + import Glibc +#endif + import XCTest -import SwiftFoundation +@testable import SwiftFoundation final class DateComponentsTest: XCTestCase { diff --git a/Tests/UnitTests/JSONTests.swift b/Tests/UnitTests/JSONTests.swift index 6907f08..90029f1 100755 --- a/Tests/UnitTests/JSONTests.swift +++ b/Tests/UnitTests/JSONTests.swift @@ -6,8 +6,12 @@ // Copyright © 2015 PureSwift. All rights reserved. // +#if os(Linux) + import Glibc +#endif + import XCTest -import SwiftFoundation +@testable import SwiftFoundation final class JSONTests: XCTestCase { diff --git a/Tests/UnitTests/POSIXTimeTests.swift b/Tests/UnitTests/POSIXTimeTests.swift old mode 100644 new mode 100755 index 1856ce2..382ca6f --- a/Tests/UnitTests/POSIXTimeTests.swift +++ b/Tests/UnitTests/POSIXTimeTests.swift @@ -13,7 +13,7 @@ #endif import XCTest -import SwiftFoundation +@testable import SwiftFoundation final class POSIXTimeTests: XCTestCase { diff --git a/Tests/UnitTests/RangeTests.swift b/Tests/UnitTests/RangeTests.swift old mode 100644 new mode 100755 index 41ce877..03da56d --- a/Tests/UnitTests/RangeTests.swift +++ b/Tests/UnitTests/RangeTests.swift @@ -6,8 +6,12 @@ // Copyright © 2016 PureSwift. All rights reserved. // +#if os(Linux) + import Glibc +#endif + import XCTest -import SwiftFoundation +@testable import SwiftFoundation final class RangeTests: XCTestCase { @@ -57,4 +61,4 @@ private extension Range where Bound: Integer { return true } -} \ No newline at end of file +} diff --git a/Tests/UnitTests/RegularExpressionTests.swift b/Tests/UnitTests/RegularExpressionTests.swift old mode 100644 new mode 100755 index 46c810e..c53b9f3 --- a/Tests/UnitTests/RegularExpressionTests.swift +++ b/Tests/UnitTests/RegularExpressionTests.swift @@ -6,9 +6,13 @@ // Copyright © 2015 PureSwift. All rights reserved. // +#if os(Linux) + import Glibc +#endif + import XCTest -import SwiftFoundation import Foundation +@testable import SwiftFoundation final class RegularExpressionTests: XCTestCase { @@ -124,15 +128,3 @@ final class RegularExpressionTests: XCTestCase { } } } - -#if os(Linux) - -extension NSRange { - - init(_ range: Range) { - - self = NSRange(CountableRange(range)) - } -} - -#endif diff --git a/Tests/UnitTests/StringTests.swift b/Tests/UnitTests/StringTests.swift old mode 100644 new mode 100755 index bcef604..f5a2d15 --- a/Tests/UnitTests/StringTests.swift +++ b/Tests/UnitTests/StringTests.swift @@ -6,7 +6,12 @@ // Copyright © 2015 PureSwift. All rights reserved. // +#if os(Linux) + import Glibc +#endif + import XCTest +@testable import SwiftFoundation final class StringTests: XCTestCase { diff --git a/Tests/UnitTests/UUIDTests.swift b/Tests/UnitTests/UUIDTests.swift old mode 100644 new mode 100755 index d11e778..5f0961c --- a/Tests/UnitTests/UUIDTests.swift +++ b/Tests/UnitTests/UUIDTests.swift @@ -6,9 +6,12 @@ // Copyright © 2015 PureSwift. All rights reserved. // +#if os(Linux) + import Glibc +#endif + import XCTest -import SwiftFoundation -import SwiftFoundation +@testable import SwiftFoundation final class UUIDTests: XCTestCase {