[testinggtk] fix the invisible chars tests



commit 00030e570e941899619efde957afb67846f598c9
Author: Björn Lindqvist <bjourne gmail com>
Date:   Fri Jul 10 11:43:14 2009 +0200

    fix the invisible chars tests

 tests/test_entry.py |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/tests/test_entry.py b/tests/test_entry.py
index e7a5a2c..7f271d6 100644
--- a/tests/test_entry.py
+++ b/tests/test_entry.py
@@ -15,7 +15,6 @@ def test_default_attributes():
     assert not entry.get_completion()
     assert not entry.get_inner_border()
     assert not entry.get_cursor_hadjustment()
-    assert entry.get_invisible_char() == u'\u25cf'
     assert entry.get_max_length() == 0
     assert entry.get_width_chars() == -1
     assert entry.get_text() == ''
@@ -24,6 +23,22 @@ def test_default_attributes():
     # Is this offset magic?
     assert entry.get_layout_offsets() == (4, -8)
 
+def test_83935():
+    '''
+    Test for the invisible char selection algorithm. In the new
+    system, we check a number of unicode characters and choose one of
+    them which is available in the current font.
+
+    :bug: #83935
+    '''
+    entry = gtk.Entry()
+    ch = entry.get_invisible_char()
+    assert ch in [u'\u25cf', u'\u2022', u'\u2731', u'\u273a', u'*']
+
+    # This character should be available in the current font.
+    layout = entry.create_pango_layout(ch)
+    assert layout.get_unknown_glyphs_count() == 0
+
 def test_delete_text():
     entry = gtk.Entry()
     entry.set_text('Hello, World!')
@@ -70,7 +85,8 @@ def test_set_get_invisible_char():
     :bug: #83935
     '''
     entry = gtk.Entry()
-    assert entry.get_invisible_char() == u'\u25cf'
+    ch = entry.get_invisible_char()
+    assert ch in [u'\u25cf', u'\u2022', u'\u2731', u'\u273a', u'*']
     entry.set_invisible_char('f')
     assert entry.get_invisible_char() == 'f'
     entry.set_invisible_char('X')



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]