test1.swift 823 B

12345678910111213141516171819202122232425262728293031
  1. import ImportsAPublicly
  2. import XCTest
  3. // Don't need to import ModuleA because of the file being a `import public`
  4. final class ExampleTests: XCTestCase {
  5. func testA() {
  6. let anA = A.with { $0.e = .a }
  7. XCTAssertEqual(anA.e, .a)
  8. }
  9. func testImportsAPublicly() {
  10. let imports = ImportsAPublicly.with { $0.a.e = .a }
  11. XCTAssertEqual(imports.a.e, .a)
  12. }
  13. func testInterop() {
  14. let anA = A.with { $0.e = .b }
  15. let imports = ImportsAPublicly.with {
  16. $0.a = anA
  17. $0.e = .b
  18. }
  19. XCTAssertEqual(imports.a.e, imports.e)
  20. let transitively = UsesATransitively.with {
  21. $0.a = anA
  22. $0.e = imports.e
  23. }
  24. XCTAssertEqual(transitively.a, anA)
  25. XCTAssertEqual(transitively.e, imports.e)
  26. }
  27. }