Skip to content

Commit c78cfe2

Browse files
committed
Add tests for diagram subcommand
1 parent c837de6 commit c78cfe2

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import XCTest
2+
3+
final class DiagramSubcommandTests: XCTestCase {
4+
func testStandardOutput() throws {
5+
let command = Bundle.productsDirectory.appendingPathComponent("swift-doc")
6+
7+
let outputDirectory = try temporaryDirectory()
8+
defer { try? FileManager.default.removeItem(at: outputDirectory) }
9+
10+
try Process.run(command: command,
11+
arguments: [
12+
"diagram",
13+
"Sources"
14+
]
15+
) { result in
16+
XCTAssertEqual(result.terminationStatus, EXIT_SUCCESS)
17+
XCTAssertEqual(result.output?.starts(with: "digraph {"), true)
18+
XCTAssertEqual(result.error, "")
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)