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}