Skip to content

Commit d7976ce

Browse files
committed
Add failing test case for IfConfigDecl/ImportDecl interaction.
1 parent 4a3def9 commit d7976ce

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Tests/SwiftFormatTests/PrettyPrint/IfConfigTests.swift

+15
Original file line numberDiff line numberDiff line change
@@ -557,4 +557,19 @@ final class IfConfigTests: PrettyPrintTestCase {
557557
configuration.indentConditionalCompilationBlocks = false
558558
assertPrettyPrintEqual(input: input, expected: input, linelength: 45, configuration: configuration)
559559
}
560+
561+
func testIfConfigDeclPartOfImport() {
562+
let input =
563+
"""
564+
#if os(Foo)
565+
@_spiOnly
566+
#endif
567+
@_spi(Foo) import Foundation
568+
569+
"""
570+
var configuration = Configuration.forTesting
571+
configuration.indentConditionalCompilationBlocks = false
572+
assertPrettyPrintEqual(input: input, expected: input, linelength: 80, configuration: configuration)
573+
574+
}
560575
}

0 commit comments

Comments
 (0)