krz/orgstar

A native macOS editor for org-mode files. editor org-mode swift

Tests/OrgCoreTests/FileSummaryTests.swift

16086b4cf2caff5328774b2cd5ae3ffe1ab65ca4
orgstar/Tests/OrgCoreTests/FileSummaryTests.swift history · blame · raw

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}