-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Indentation + PodcastType: Make Equatable and Codable (#17)
This will enable tools built on top of Plot (like Publish) to encode types containing these kinds of values. Also improve the Linux compatibility tooling to detect if a new test case was added only on Apple Platforms.
- Loading branch information
1 parent
0010086
commit 00bd4d6
Showing
5 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import XCTest | ||
import Plot | ||
|
||
final class IndentationTests: XCTestCase { | ||
func testSpacesCoding() throws { | ||
let indentation = Indentation(kind: .spaces(4)) | ||
let data = try JSONEncoder().encode(indentation) | ||
let decoded = try JSONDecoder().decode(Indentation.self, from: data) | ||
XCTAssertEqual(indentation, decoded) | ||
} | ||
|
||
func testTabsCoding() throws { | ||
let indentation = Indentation(kind: .tabs(1)) | ||
let data = try JSONEncoder().encode(indentation) | ||
let decoded = try JSONDecoder().decode(Indentation.self, from: data) | ||
XCTAssertEqual(indentation, decoded) | ||
} | ||
} | ||
|
||
extension IndentationTests { | ||
static var allTests: Linux.TestList<IndentationTests> { | ||
[ | ||
("testSpacesCoding", testSpacesCoding), | ||
("testTabsCoding", testTabsCoding) | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters