mirror of
https://github.com/apple/swift-protobuf.git
synced 2026-06-16 10:24:34 +00:00
604e01ab4f
# Motivation We have seen a few issues with the SPM plugin over time that we could have caught with tests. # Modification This PR adds a new tested `PluginExamples` folder that contains a standalone package that exercises the plugin in various configuration. This does not only help in testing the various configurations but also is a good resource for people that want to adopt the plugin. # Result We now have tests in place making sure our plugin works
23 lines
505 B
Swift
23 lines
505 B
Swift
import Simple
|
|
import Nested
|
|
import Import
|
|
|
|
import XCTest
|
|
|
|
final class ExampleTests: XCTestCase {
|
|
func testSimple() {
|
|
let simple = Simple.with { $0.name = "Simple" }
|
|
XCTAssertEqual(simple.name, "Simple")
|
|
}
|
|
|
|
func testNested() {
|
|
let nested = Nested.with { $0.name = "Nested" }
|
|
XCTAssertEqual(nested.name, "Nested")
|
|
}
|
|
|
|
func testImport() {
|
|
let foo = Foo.with { $0.bar = .with { $0.name = "Bar" } }
|
|
XCTAssertEqual(foo.bar.name, "Bar")
|
|
}
|
|
}
|