krz/hutch

an ios client for sourcehut

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

main: HutchTests/SettingsViewTests.swift · raw

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