We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ForInStmtSyntax
1 parent 7f73088 commit d6f56deCopy full SHA for d6f56de
Tests/SwiftSyntaxBuilderTest/ForInStmtTests.swift
@@ -57,4 +57,28 @@ final class ForInStmtTests: XCTestCase {
57
assertBuildResult(builder, expected, line: line)
58
}
59
60
+
61
+ func testEffectiveForInStmtSyntax() throws {
62
+ let buildable = ForInStmtSyntax(
63
+ tryKeyword: .keyword(.try),
64
+ awaitKeyword: .keyword(.await),
65
+ pattern: PatternSyntax("foo"),
66
+ sequenceExpr: ExprSyntax("bar"),
67
+ body: CodeBlockSyntax(
68
+ statements: [
69
+ .init(item: .decl("let baz = await foo.baz")),
70
+ .init(item: .expr("print(foo.baz)"))
71
+ ]
72
+ )
73
74
+ assertBuildResult(
75
+ buildable,
76
+ """
77
+ for try await foo in bar {
78
+ let baz = await foo.baz
79
+ print(foo.baz)
80
+ }
81
82
83
84
0 commit comments