Convert from git submodule to plain vendored copy. No push access to upstream nodes-app/swift-markdown-engine meant our local fix commit (05c1720) was stranded and unreachable from any remote on fresh clones/CI. Vendoring as plain files folds it into normal repo history instead.
30 lines
770 B
Swift
30 lines
770 B
Swift
//
|
|
// BacktickCensusTests.swift
|
|
// MarkdownEngine
|
|
//
|
|
// Created by Luca Chen on 07.07.26.
|
|
//
|
|
|
|
import Foundation
|
|
import Testing
|
|
@testable import MarkdownEngine
|
|
|
|
@Suite("Backtick census")
|
|
struct BacktickCensusTests {
|
|
|
|
@Test func matchesComponentsSemantics() {
|
|
let samples = [
|
|
"", "`", "``", "```", "````", "`````", "``````",
|
|
"a```b```c",
|
|
"x\n```swift\nlet a = 1\n```\ny",
|
|
"inline `code` only",
|
|
"```````"
|
|
]
|
|
for sample in samples {
|
|
let expected = sample.components(separatedBy: "```").count - 1
|
|
#expect(MarkdownDetection.tripleBacktickCount(in: sample as NSString) == expected,
|
|
"mismatch for \(sample.debugDescription)")
|
|
}
|
|
}
|
|
}
|