@@ -1215,7 +1215,8 @@ class BlockDirectiveArgumentParserTests: XCTestCase {
1215
1215
"""
1216
1216
)
1217
1217
}
1218
-
1218
+
1219
+ #if !(compiler(>=6.0) && canImport(Testing))
1219
1220
// FIXME: swift-testing macro for specifying the relationship between a bug and a test
1220
1221
// Uncomment the following code when we integrate swift-testing
1221
1222
// @Test("Directive MultiLine WithoutContent Parsing", .bug("#152", relationship: .verifiesFix))
@@ -1238,4 +1239,34 @@ class BlockDirectiveArgumentParserTests: XCTestCase {
1238
1239
"""#
1239
1240
XCTAssertEqual ( expected, document. debugDescription ( options: . printSourceLocations) )
1240
1241
}
1242
+ #endif
1243
+ }
1244
+
1245
+ #if compiler(>=6.0) && canImport(Testing)
1246
+ import Testing
1247
+
1248
+ struct _BlockDirectiveArgumentParserTests {
1249
+ @Test (
1250
+ " Directive MultiLine WithoutContent Parsing " ,
1251
+ . bug( " https://github.com/swiftlang/swift-markdown/issues " , id: " #152 " , " Verify fix of #152 " )
1252
+ )
1253
+ func directiveMultiLineWithoutContentParsing( ) throws {
1254
+ let source = #"""
1255
+ @Image(
1256
+ source: "example.png",
1257
+ alt: "Example image"
1258
+ )
1259
+ """#
1260
+ let document = Document ( parsing: source, options: . parseBlockDirectives)
1261
+ _ = try #require( document. child ( at: 0 ) as? BlockDirective )
1262
+ let expected = #"""
1263
+ Document @1:1-4:2
1264
+ └─ BlockDirective @1:1-4:2 name: "Image"
1265
+ ├─ Argument text segments:
1266
+ | @2:1-2:25: " source: \"example.png\","
1267
+ | @3:1-3:23: " alt: \"Example image\""
1268
+ """#
1269
+ #expect( document. debugDescription ( options: . printSourceLocations) == expected)
1270
+ }
1241
1271
}
1272
+ #endif
0 commit comments