@@ -152,7 +152,7 @@ final class SwiftTermUnicode {
152152 #expect( char0_0 == " 👩❤️👨 " )
153153 }
154154
155- func testCJKCharacterPositioning ( )
155+ @ Test func testCJKCharacterPositioning ( )
156156 {
157157 let h = HeadlessTerminal ( queue: SwiftTermTests . queue) { exitCode in }
158158 let t = h. terminal!
@@ -162,23 +162,23 @@ final class SwiftTermUnicode {
162162 t. feed ( text: " あいう " )
163163
164164 // Verify character positions
165- XCTAssertEqual ( t. getCharacter ( col: 0 , row: 0 ) , " あ " )
166- XCTAssertEqual ( t. getCharacter ( col: 1 , row: 0 ) , " \u{0} " ) // placeholder
167- XCTAssertEqual ( t. getCharacter ( col: 2 , row: 0 ) , " い " )
168- XCTAssertEqual ( t. getCharacter ( col: 3 , row: 0 ) , " \u{0} " ) // placeholder
169- XCTAssertEqual ( t. getCharacter ( col: 4 , row: 0 ) , " う " )
170- XCTAssertEqual ( t. getCharacter ( col: 5 , row: 0 ) , " \u{0} " ) // placeholder
165+ #expect ( t. getCharacter ( col: 0 , row: 0 ) == " あ " )
166+ #expect ( t. getCharacter ( col: 1 , row: 0 ) == " \u{0} " ) // placeholder
167+ #expect ( t. getCharacter ( col: 2 , row: 0 ) == " い " )
168+ #expect ( t. getCharacter ( col: 3 , row: 0 ) == " \u{0} " ) // placeholder
169+ #expect ( t. getCharacter ( col: 4 , row: 0 ) == " う " )
170+ #expect ( t. getCharacter ( col: 5 , row: 0 ) == " \u{0} " ) // placeholder
171171
172172 // Verify character widths
173- XCTAssertEqual ( t. getCharData ( col: 0 , row: 0 ) ? . width, 2 )
174- XCTAssertEqual ( t. getCharData ( col: 2 , row: 0 ) ? . width, 2 )
175- XCTAssertEqual ( t. getCharData ( col: 4 , row: 0 ) ? . width, 2 )
173+ #expect ( t. getCharData ( col: 0 , row: 0 ) ? . width == 2 )
174+ #expect ( t. getCharData ( col: 2 , row: 0 ) ? . width == 2 )
175+ #expect ( t. getCharData ( col: 4 , row: 0 ) ? . width == 2 )
176176
177177 // Cursor should be at column 6 after 3 double-width characters
178- XCTAssertEqual ( t. buffer. x, 6 )
178+ #expect ( t. buffer. x == 6 )
179179 }
180180
181- func testCJKMixedWithAscii ( )
181+ @ Test func testCJKMixedWithAscii ( )
182182 {
183183 let h = HeadlessTerminal ( queue: SwiftTermTests . queue) { exitCode in }
184184 let t = h. terminal!
@@ -187,59 +187,48 @@ final class SwiftTermUnicode {
187187 t. feed ( text: " aあbいc " )
188188
189189 // 'a' at col 0 (width 1)
190- XCTAssertEqual ( t. getCharacter ( col: 0 , row: 0 ) , " a " )
191- XCTAssertEqual ( t. getCharData ( col: 0 , row: 0 ) ? . width, 1 )
190+ #expect ( t. getCharacter ( col: 0 , row: 0 ) == " a " )
191+ #expect ( t. getCharData ( col: 0 , row: 0 ) ? . width == 1 )
192192
193193 // 'あ' at col 1 (width 2)
194- XCTAssertEqual ( t. getCharacter ( col: 1 , row: 0 ) , " あ " )
195- XCTAssertEqual ( t. getCharData ( col: 1 , row: 0 ) ? . width, 2 )
194+ #expect ( t. getCharacter ( col: 1 , row: 0 ) == " あ " )
195+ #expect ( t. getCharData ( col: 1 , row: 0 ) ? . width == 2 )
196196
197197 // 'b' at col 3 (width 1)
198- XCTAssertEqual ( t. getCharacter ( col: 3 , row: 0 ) , " b " )
199- XCTAssertEqual ( t. getCharData ( col: 3 , row: 0 ) ? . width, 1 )
198+ #expect ( t. getCharacter ( col: 3 , row: 0 ) == " b " )
199+ #expect ( t. getCharData ( col: 3 , row: 0 ) ? . width == 1 )
200200
201201 // 'い' at col 4 (width 2)
202- XCTAssertEqual ( t. getCharacter ( col: 4 , row: 0 ) , " い " )
203- XCTAssertEqual ( t. getCharData ( col: 4 , row: 0 ) ? . width, 2 )
202+ #expect ( t. getCharacter ( col: 4 , row: 0 ) == " い " )
203+ #expect ( t. getCharData ( col: 4 , row: 0 ) ? . width == 2 )
204204
205205 // 'c' at col 6 (width 1)
206- XCTAssertEqual ( t. getCharacter ( col: 6 , row: 0 ) , " c " )
207- XCTAssertEqual ( t. getCharData ( col: 6 , row: 0 ) ? . width, 1 )
206+ #expect ( t. getCharacter ( col: 6 , row: 0 ) == " c " )
207+ #expect ( t. getCharData ( col: 6 , row: 0 ) ? . width == 1 )
208208
209209 // Cursor should be at column 7
210- XCTAssertEqual ( t. buffer. x, 7 )
210+ #expect ( t. buffer. x == 7 )
211211 }
212212
213- func testChineseCharacterPositioning ( )
213+ @ Test func testChineseCharacterPositioning ( )
214214 {
215215 let h = HeadlessTerminal ( queue: SwiftTermTests . queue) { exitCode in }
216216 let t = h. terminal!
217217
218218 // Test Chinese characters (also double-width)
219219 t. feed ( text: " 中文字 " )
220220
221- XCTAssertEqual ( t. getCharacter ( col: 0 , row: 0 ) , " 中 " )
222- XCTAssertEqual ( t. getCharacter ( col: 2 , row: 0 ) , " 文 " )
223- XCTAssertEqual ( t. getCharacter ( col: 4 , row: 0 ) , " 字 " )
221+ #expect ( t. getCharacter ( col: 0 , row: 0 ) == " 中 " )
222+ #expect ( t. getCharacter ( col: 2 , row: 0 ) == " 文 " )
223+ #expect ( t. getCharacter ( col: 4 , row: 0 ) == " 字 " )
224224
225225 // All should be width 2
226- XCTAssertEqual ( t. getCharData ( col: 0 , row: 0 ) ? . width, 2 )
227- XCTAssertEqual ( t. getCharData ( col: 2 , row: 0 ) ? . width, 2 )
228- XCTAssertEqual ( t. getCharData ( col: 4 , row: 0 ) ? . width, 2 )
226+ #expect ( t. getCharData ( col: 0 , row: 0 ) ? . width == 2 )
227+ #expect ( t. getCharData ( col: 2 , row: 0 ) ? . width == 2 )
228+ #expect ( t. getCharData ( col: 4 , row: 0 ) ? . width == 2 )
229229
230- XCTAssertEqual ( t. buffer. x, 6 )
230+ #expect ( t. buffer. x == 6 )
231231 }
232-
233- static var allTests = [
234- ( " testCombiningCharacters " , testCombiningCharacters) ,
235- ( " testEmoji " , testEmoji) ,
236- ( " testEmojiWithModifierBase " , testEmojiWithModifierBase) ,
237- ( " testEmojiZWJSequence " , testEmojiZWJSequence) ,
238- ( " testEmojiZWJSequenceSimple " , testEmojiZWJSequenceSimple) ,
239- ( " testCJKCharacterPositioning " , testCJKCharacterPositioning) ,
240- ( " testCJKMixedWithAscii " , testCJKMixedWithAscii) ,
241- ( " testChineseCharacterPositioning " , testChineseCharacterPositioning) ,
242- ]
243232 @Test func testZwJSequencePreservesVariationSelector16( ) {
244233 let h = HeadlessTerminal ( queue: SwiftTermTests . queue) { exitCode in }
245234 let t = h. terminal!
0 commit comments