Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: disable the LogHandle tests on Windows #634

Merged
merged 1 commit into from
Jun 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions Tests/SwiftDocCUtilitiesTests/Utility/LogHandleTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class LogHandleTests: XCTestCase {

/// Test that ``LogHandle`` doesn't append extra newlines to output
/// - Bug: rdar://73462272
func testWriteToStandardOutput() {
func testWriteToStandardOutput() throws {
#if os(Windows)
throw XCTSkip("cannot reassign file handles on Windows")
#else
let pipe = Pipe()

// dup stdout to restore later
Expand Down Expand Up @@ -50,9 +53,13 @@ class LogHandleTests: XCTestCase {
========================================
"""
)
#endif
}

func testFlushesStandardOutput() {
func testFlushesStandardOutput() throws {
#if os(Windows)
throw XCTSkip("cannot reassign file handles on Windows")
#else
let pipe = Pipe()

// dup stdout to restore later
Expand All @@ -67,9 +74,13 @@ class LogHandleTests: XCTestCase {
let data = pipe.fileHandleForReading.availableData
let text = String(data: data, encoding: .utf8)
XCTAssertEqual(text, "No newlines here", "\(LogHandle.self) didn't flush stdout")
#endif
}

func testFlushesStandardError() {
func testFlushesStandardError() throws {
#if os(Windows)
throw XCTSkip("cannot reassign file handles on Windows")
#else
let pipe = Pipe()

// dup stdout to restore later
Expand All @@ -84,5 +95,6 @@ class LogHandleTests: XCTestCase {
let data = pipe.fileHandleForReading.availableData
let text = String(data: data, encoding: .utf8)
XCTAssertEqual(text, "No newlines here", "\(LogHandle.self) didn't flush stderr")
#endif
}
}