Skip to content

Commit e819555

Browse files
authored
Tests: treat Windows as Linux (#620)
Treat Windows similarly to Linux as the functionality is near similar in completeness. While it is possible to support the DirectoryMonitor on Windows, it is not yet implemented in DocC, so simply treat it as we do Linux.
1 parent 651ee9c commit e819555

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Tests/SwiftDocCTests/Servers/DocumentationSchemeHandlerTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DocumentationSchemeHandlerTests: XCTestCase {
2424
forResource: "TestBundle", withExtension: "docc", subdirectory: "Test Bundles")!
2525

2626
func testDocumentationSchemeHandler() {
27-
#if !os(Linux) && !os(Android)
27+
#if !os(Linux) && !os(Android) && !os(Windows)
2828
let topicSchemeHandler = DocumentationSchemeHandler(withTemplateURL: templateURL)
2929

3030
let request = URLRequest(url: baseURL.appendingPathComponent("/images/figure1.jpg"))
@@ -50,7 +50,7 @@ class DocumentationSchemeHandlerTests: XCTestCase {
5050
}
5151

5252
func testSetData() {
53-
#if !os(Linux) && !os(Android)
53+
#if !os(Linux) && !os(Android) && !os(Windows)
5454
let topicSchemeHandler = DocumentationSchemeHandler(withTemplateURL: templateURL)
5555

5656
let data = "hello!".data(using: .utf8)!

Tests/SwiftDocCUtilitiesTests/DirectoryMonitorTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import XCTest
1212
@testable import SwiftDocCUtilities
1313

14-
#if !os(Linux) && !os(Android)
14+
#if !os(Linux) && !os(Android) && !os(Windows)
1515
fileprivate extension NSNotification.Name {
1616
static let testNodeUpdated = NSNotification.Name(rawValue: "testNodeUpdated")
1717
static let testDirectoryReloaded = NSNotification.Name(rawValue: "testDirectoryReloaded")
@@ -24,7 +24,7 @@ func fileURLsAreEqual(_ url1: URL, _ url2: URL) -> Bool {
2424
#endif
2525

2626
class DirectoryMonitorTests: XCTestCase {
27-
#if !os(Linux) && !os(Android)
27+
#if !os(Linux) && !os(Android) && !os(Windows)
2828
// - MARK: Directory watching test infra
2929

3030
/// Method that automates setting up a directory monitor, setting up the relevant expectations for a test,
@@ -118,7 +118,7 @@ class DirectoryMonitorTests: XCTestCase {
118118
/// Tests a succession of file system changes and verifies that they produce
119119
/// the expected monitor events.
120120
func testMonitorUpdates() throws {
121-
#if !os(Linux) && !os(Android)
121+
#if !os(Linux) && !os(Android) && !os(Windows)
122122

123123
// Create temp folder & sub-folder.
124124
let tempSubfolderURL = try createTemporaryDirectory(named: "subfolder")
@@ -167,7 +167,7 @@ class DirectoryMonitorTests: XCTestCase {
167167
}
168168

169169
func testMonitorDoesNotTriggerUpdates() throws {
170-
#if !os(Linux) && !os(Android)
170+
#if !os(Linux) && !os(Android) && !os(Windows)
171171

172172
// Create temp folder & sub-folder.
173173
let tempSubfolderURL = try createTemporaryDirectory(named: "subfolder")
@@ -200,7 +200,7 @@ class DirectoryMonitorTests: XCTestCase {
200200

201201
/// Tests a zero sum change aggregation triggers an event.
202202
func testMonitorZeroSumSizeChangesUpdates() throws {
203-
#if !os(Linux) && !os(Android)
203+
#if !os(Linux) && !os(Android) && !os(Windows)
204204

205205
// Create temp folder & sub-folder.
206206
let tempSubfolderURL = try createTemporaryDirectory(named: "subfolder")

0 commit comments

Comments
 (0)