import Foundation import Testing @testable import OrgCore /// The hand-written scans for list item counters and description tags against the /// patterns they replace. struct ListItemScanTests { static let pieces = ["[@", "start:", "3", "12", "b", "B", "]", " ", "\t", "::", ":", "a", "é", "x y", "[", "\\n"] static func strings() -> [Substring] { var generator = SystemRandomNumberGenerator() var out: [Substring] = ["", "[@3]", "[@start:3] x", "[@b]", "[@start:]", "[@start:b]", "[@3", "[@ab]", "a :: b", "a ::", "a::b", "a :: b :: c", "a\t::\tb", " :: x", "::", "a ::b", "tag :: rest", "x :: y\nz :: w"] for _ in 0..<5000 { let count = Int.random(in: 1...7, using: &generator) out.append(Substring((0..