File tree Expand file tree Collapse file tree 3 files changed +16
-14
lines changed
Sources/EnumeratorMacroImpl
Tests/EnumeratorMacroTests Expand file tree Collapse file tree 3 files changed +16
-14
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,8 @@ extension EnumeratorMacroType: MemberMacro {
82
82
guard let rendered else {
83
83
return nil
84
84
}
85
- return ( rendered, syntax)
85
+ let noEmptyLines = rendered. split ( separator: " \n " ) . joined ( separator: " \n " )
86
+ return ( noEmptyLines, syntax)
86
87
} catch {
87
88
let message : MacroError
88
89
let errorSyntax : SyntaxProtocol
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ final class EnumeratorMacroTests: XCTestCase {
15
15
{{#cases}}
16
16
case .{{name}}:
17
17
"{{name}}"
18
+
19
+
20
+
18
21
{{/cases}}
19
22
}
20
23
}
Original file line number Diff line number Diff line change @@ -48,19 +48,17 @@ final class TransformTests: XCTestCase {
48
48
}
49
49
50
50
func testCommentsValueConditionalSection( ) throws {
51
- do {
52
- let template = """
53
- {{^exists(custom_params(keyValues(comments)))}}
54
- thing!
55
- {{/exists(custom_params(keyValues(comments)))}}
56
- """
57
- let render = try MustacheTemplate (
58
- string: " {{%CONTENT_TYPE:TEXT}} \n " + template
59
- ) . render (
60
- testCases [ 2 ]
61
- )
62
- XCTAssertEqual ( render, " thing! \n " )
63
- }
51
+ let template = """
52
+ {{^exists(custom_params(keyValues(comments)))}}
53
+ thing!
54
+ {{/exists(custom_params(keyValues(comments)))}}
55
+ """
56
+ let render = try MustacheTemplate (
57
+ string: " {{%CONTENT_TYPE:TEXT}} \n " + template
58
+ ) . render (
59
+ testCases [ 2 ]
60
+ )
61
+ XCTAssertEqual ( render, " thing! \n " )
64
62
}
65
63
66
64
let testCases : [ ECase ] = [
You can’t perform that action at this time.
0 commit comments