mirror of
https://github.com/phranck/TUIkit.git
synced 2026-06-20 09:54:37 +00:00
Add @MainActor to View, ViewModifier, Renderable, App, Scene protocols and all builders (ViewBuilder, SceneBuilder, ChildInfoProvider). Update renderToBuffer(), makeChildInfo(), resolveChildInfos() for main-actor isolation. Mark generic Equatable conformances with @preconcurrency. Update all 45 test suites with @MainActor annotation.
30 lines
830 B
Swift
30 lines
830 B
Swift
// 🖥️ TUIKit — Terminal UI Kit for Swift
|
|
// NavigationTitleKeyTests.swift
|
|
//
|
|
// Created by LAYERED.work
|
|
// License: MIT
|
|
|
|
import Testing
|
|
|
|
@testable import TUIkit
|
|
|
|
@MainActor
|
|
@Suite("NavigationTitleKey Tests")
|
|
struct NavigationTitleKeyTests {
|
|
|
|
@Test("NavigationTitleKey uses last-value reduce")
|
|
func lastValueReduce() {
|
|
var value = NavigationTitleKey.defaultValue
|
|
NavigationTitleKey.reduce(value: &value) { "First Title" }
|
|
NavigationTitleKey.reduce(value: &value) { "Second Title" }
|
|
#expect(value == "Second Title")
|
|
}
|
|
|
|
@Test("NavigationTitleKey works with PreferenceValues")
|
|
func withPreferenceValues() {
|
|
var values = PreferenceValues()
|
|
values[NavigationTitleKey.self] = "My Title"
|
|
#expect(values[NavigationTitleKey.self] == "My Title")
|
|
}
|
|
}
|