Tests/OrgPresentationTests/CommentLineTests.swift

e159ec59dfbacc1644db740591e310c4c1663fed
orgstar/Tests/OrgPresentationTests/CommentLineTests.swift

13 lines · 511 bytes

 1import Foundation
 2import Testing
 3@testable import OrgPresentation
 4
 5struct CommentLineTests {
 6    @Test func matchesThePattern() {
 7        let lines = ["#", "# x", "#+TITLE: a", "  #\n", "\t# \n", "#x", "a # b", "", "#\r\n", "#\r", "#\u{2028}", " #+\n", "##", "  x#"]
 8        for line in lines {
 9            let expected = line.range(of: "^[ \\t]*#([ +]|$)", options: .regularExpression) != nil
10            #expect(Presentation.isCommentOrKeyword(line) == expected, "\(line.debugDescription)")
11        }
12    }
13}
Keyboard shortcuts

Global

⌘K
Command palette & jump
/
Focus search
?
Show this help
g d
Dashboard
g e
Explore repositories
g n
Notifications

Repository & editor

t
Find file in repository
y
Copy immutable SHA permalink
g c
Code tab
g i
Issues tab
g m
Merge requests tab
g b
Builds tab
⌘↵
Submit active form