mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-03 22:27:13 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
35 lines
1.3 KiB
Swift
35 lines
1.3 KiB
Swift
#if canImport(UIKit)
|
|
import XCTest
|
|
import UIKit
|
|
@testable import RichTextEditorUIKit
|
|
import RichTextEditorCore
|
|
|
|
final class WritingDirectionStyleTests: XCTestCase {
|
|
func test_paragraphStyle_appliesExplicitBaseWritingDirection() {
|
|
let ps = StyleSheet.default.paragraphStyle(for: .body, attributes: .default,
|
|
baseWritingDirection: .rightToLeft)
|
|
XCTAssertEqual(ps.baseWritingDirection, .rightToLeft)
|
|
}
|
|
|
|
func test_paragraphStyle_defaultsToNatural() {
|
|
let ps = StyleSheet.default.paragraphStyle(for: .body, attributes: .default)
|
|
XCTAssertEqual(ps.baseWritingDirection, .natural)
|
|
}
|
|
|
|
func test_naturalAlignment_mapsToNSTextAlignmentNatural() {
|
|
let ps = StyleSheet.default.paragraphStyle(for: .body, attributes: .default) // .default = .natural
|
|
XCTAssertEqual(ps.alignment, .natural)
|
|
}
|
|
|
|
func test_mapper_defaultBaseWritingDirection_isNatural() {
|
|
XCTAssertEqual(AttributedStringMapper().baseWritingDirection, .natural)
|
|
}
|
|
|
|
func test_tableCellVariant_preservesBaseWritingDirection() {
|
|
var m = AttributedStringMapper()
|
|
m.baseWritingDirection = .rightToLeft
|
|
XCTAssertEqual(m.tableCellVariant().baseWritingDirection, .rightToLeft)
|
|
}
|
|
}
|
|
#endif
|