krz/hutch

an ios client for sourcehut

clone: git clone https://gitbay.org/krz/hutch.git

v3.0.0: HutchTests/SettingsViewTests.swift · raw

 1import Foundation
 2import Testing
 3@testable import Hutch
 4
 5struct SettingsViewTests {
 6
 7    @Test
 8    @MainActor
 9    func settingsBioAttributedStringPreservesInlineMarkdown() {
10        let attributed = settingsBioAttributedString("Hello **world** and [link](https://example.com)")
11
12        #expect(String(attributed.characters).contains("Hello world and link"))
13    }
14
15    @Test
16    @MainActor
17    func settingsBioAttributedStringFallsBackForInvalidMarkdown() {
18        let attributed = settingsBioAttributedString("[broken")
19
20        #expect(String(attributed.characters) == "[broken")
21    }
22}