Tests/OrgCoreTests/FileSummaryTests.swift

2df4420ff51f7e97a9c06eacf814f64cdb5a4351
orgstar/Tests/OrgCoreTests/FileSummaryTests.swift

12 lines · 535 bytes

 1import Testing
 2@testable import OrgCore
 3
 4struct FileSummaryTests {
 5    @Test func readsKeywordsTagsAndHeadings() {
 6        let summary = FileSummary("#+title: Notes\n#+AUTHOR: Me\n#+FILETAGS: :home:\n* TODO [#A] Fix the sink [1/2] :home:diy:\n** Buy parts\n")
 7        #expect(summary.title == "Notes" && summary.author == "Me" && summary.description == nil)
 8        #expect(summary.tags == ["home", "diy"])
 9        #expect(summary.headings == ["Fix the sink", "Buy parts"])
10        #expect(FileSummary("plain\n").title == nil)
11    }
12}
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