gitbayTests/MarkupPreviewTests.swift

v1.10.0
gitbay-ios/gitbayTests/MarkupPreviewTests.swift history · blame · raw

23 lines · 856 bytes

 1import Testing
 2@testable import gitbay
 3
 4struct MarkupPreviewFormatTests {
 5
 6    @Test func orgFilesRenderAsOrg() {
 7        #expect(MarkupPreview.format(forFile: "README.org") == "org")
 8        #expect(MarkupPreview.format(forFile: "profile/README.org") == "org")
 9    }
10
11    @Test func markdownFilesRenderAsMarkdown() {
12        #expect(MarkupPreview.format(forFile: "README.md") == "md")
13        #expect(MarkupPreview.format(forFile: "notes.markdown") == "md")
14        #expect(MarkupPreview.format(forFile: "CHANGES.MD") == "md")
15    }
16
17    /// Source files show as source, so there is nothing to preview.
18    @Test func otherFilesHaveNoPreview() {
19        #expect(MarkupPreview.format(forFile: "main.swift") == nil)
20        #expect(MarkupPreview.format(forFile: "Makefile") == nil)
21        #expect(MarkupPreview.format(forFile: "notes.txt") == nil)
22    }
23}