mirror of
https://github.com/ichmagmaus111/ghostgram.git
synced 2026-11-04 06:37:08 +01:00
Ghostgram for iOS, rebuilt from scratch on Telegram iOS 13.0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
847 B
Swift
29 lines
847 B
Swift
#if canImport(UIKit)
|
|
import XCTest
|
|
import UIKit
|
|
@testable import RichTextEditorUIKit
|
|
|
|
final class BaseDirectionTests: XCTestCase {
|
|
private func layout(_ s: String) -> BlockLayoutEngine {
|
|
makeBlockLayout(attributedString: NSAttributedString(
|
|
string: s, attributes: [.font: UIFont.systemFont(ofSize: 17)]), width: 200)
|
|
}
|
|
|
|
func test_arabic_isRTL() {
|
|
XCTAssertEqual(layout("مرحبا بالعالم").baseDirection(atOffset: 0), .rightToLeft)
|
|
}
|
|
|
|
func test_hebrew_isRTL() {
|
|
XCTAssertEqual(layout("שלום עולם").baseDirection(atOffset: 0), .rightToLeft)
|
|
}
|
|
|
|
func test_latin_isLTR() {
|
|
XCTAssertEqual(layout("Hello world").baseDirection(atOffset: 0), .leftToRight)
|
|
}
|
|
|
|
func test_empty_isNil() {
|
|
XCTAssertNil(layout("").baseDirection(atOffset: 0))
|
|
}
|
|
}
|
|
#endif
|