Skip to content

Commit 374bdac

Browse files
committed
Add unit test to variable decl with existenital type
1 parent 326d6f1 commit 374bdac

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

Tests/SpyableMacroTests/Factories/UT_SpyFactory.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,29 @@ final class UT_SpyFactory: XCTestCase {
357357
)
358358
}
359359

360+
func testDeclarationExistentialVariable() throws {
361+
try assertProtocol(
362+
withDeclaration: """
363+
protocol ServiceProtocol {
364+
var data: any Codable { get set }
365+
}
366+
""",
367+
expectingClassDeclaration: """
368+
class ServiceProtocolSpy: ServiceProtocol {
369+
var data: any Codable {
370+
get {
371+
underlyingData
372+
}
373+
set {
374+
underlyingData = newValue
375+
}
376+
}
377+
var underlyingData: (any Codable)!
378+
}
379+
"""
380+
)
381+
}
382+
360383
func testDeclarationClosureVariable() throws {
361384
try assertProtocol(
362385
withDeclaration: """

0 commit comments

Comments
 (0)