Runa simplified version of the font rendering test on macOS

This commit is contained in:
Kovid Goyal 2017-11-05 20:57:41 +05:30
parent 6c98b676bb
commit dc7d705c87
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -3,7 +3,6 @@
# License: GPL v3 Copyright: 2017, Kovid Goyal <kovid at kovidgoyal.net>
from collections import OrderedDict
import unittest
from kitty.fast_data_types import (
set_send_sprite_to_gpu, sprite_map_set_layout,
@ -54,11 +53,13 @@ def test_box_drawing(self):
test_render_line(line)
self.assertEqual(len(self.sprites), prerendered + len(box_chars))
@unittest.skipIf(isosx, 'macOS is too underpowered')
def test_rendering(self):
text = 'He\u0347\u0305llo\u0341, w\u0302or\u0306l\u0354d!'
# macOS has no fonts capable of rendering combining chars
if isosx:
text = text.encode('ascii', 'ignore').decode('ascii')
cells = render_string(text)[-1]
self.ae(len(cells), len(text.encode('ascii', 'ignore')))
text = '你好,世界'
cells = render_string(text)[-1]
self.ae(len(cells), 9)
self.ae(len(cells), 9 - (4 if isosx else 0))