Skip to content

Commit f63a4f3

Browse files
committed
add tests for var signatures
1 parent 737a4ec commit f63a4f3

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

Sources/MarkdownPluginSwiftTests/Autographs.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,36 @@ struct Autographs
8585
#expect(self.landmarks.output == ["(Int)->(Int)->Int"])
8686
}
8787

88+
@Test mutating
89+
func Var1()
90+
{
91+
let decl:String = "static var x: (String)? { get }"
92+
let _:Signature<Never>.Expanded = .init(decl, landmarks: &self.landmarks)
93+
94+
#expect(self.landmarks.inputs == [])
95+
#expect(self.landmarks.output == ["String?"])
96+
}
97+
98+
@Test mutating
99+
func Var2()
100+
{
101+
let decl:String = "static var x: (T?, Set<T>) { get set }"
102+
let _:Signature<Never>.Expanded = .init(decl, landmarks: &self.landmarks)
103+
104+
#expect(self.landmarks.inputs == [])
105+
#expect(self.landmarks.output == ["T?", "Set<T>"])
106+
}
107+
108+
@Test mutating
109+
func Var3()
110+
{
111+
let decl:String = "var x: (Int, Int) -> (Int) -> Int"
112+
let _:Signature<Never>.Expanded = .init(decl, landmarks: &self.landmarks)
113+
114+
#expect(self.landmarks.inputs == [])
115+
#expect(self.landmarks.output == ["(Int,Int)->(Int)->Int"])
116+
}
117+
88118
@Test mutating
89119
func SomeAndAnyTypes()
90120
{

0 commit comments

Comments
 (0)