Tests/OrgCoreTests/SemanticValueTests.swift

9cb5e048a0e70a986be15162bcd4f49f71836582
orgstar/Tests/OrgCoreTests/SemanticValueTests.swift

16 lines · 532 bytes

 1import Testing
 2@testable import OrgCore
 3
 4struct SemanticValueTests {
 5    @Test func parseHeaderArguments() {
 6        let pairs = HeaderArguments.parse("ignored :results output silent :dir /tmp :VAR x=1")
 7        #expect(pairs.map { "\($0.key)=\($0.value)" } == [":results=output silent", ":dir=/tmp", ":var=x=1"])
 8    }
 9
10    @Test func widths() {
11        #expect(displayWidth("abc") == 3)
12        #expect(displayWidth("日本") == 4)
13        #expect(displayWidth("e\u{301}") == 1)
14        #expect(displayWidth("😀") == 2)
15    }
16}
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