Skip to content

Commit bef6d95

Browse files
committed
Add swift-testing integration
1 parent 8986fc2 commit bef6d95

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

Tests/MarkdownTests/Parsing/BlockDirectiveParserTests.swift

+32-1
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,8 @@ class BlockDirectiveArgumentParserTests: XCTestCase {
12151215
"""
12161216
)
12171217
}
1218-
1218+
1219+
#if !(compiler(>=6.0) && canImport(Testing))
12191220
// FIXME: swift-testing macro for specifying the relationship between a bug and a test
12201221
// Uncomment the following code when we integrate swift-testing
12211222
// @Test("Directive MultiLine WithoutContent Parsing", .bug("#152", relationship: .verifiesFix))
@@ -1238,4 +1239,34 @@ class BlockDirectiveArgumentParserTests: XCTestCase {
12381239
"""#
12391240
XCTAssertEqual(expected, document.debugDescription(options: .printSourceLocations))
12401241
}
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+
}
12411271
}
1272+
#endif

0 commit comments

Comments
 (0)