testinggtk r131 - trunk/tests/pango
- From: bjornl svn gnome org
- To: svn-commits-list gnome org
- Subject: testinggtk r131 - trunk/tests/pango
- Date: Sun, 15 Jun 2008 04:53:56 +0000 (UTC)
Author: bjornl
Date: Sun Jun 15 04:53:56 2008
New Revision: 131
URL: http://svn.gnome.org/viewvc/testinggtk?rev=131&view=rev
Log:
Test font description strings that result in 0 size
Modified:
trunk/tests/pango/test_fontdescription.py
Modified: trunk/tests/pango/test_fontdescription.py
==============================================================================
--- trunk/tests/pango/test_fontdescription.py (original)
+++ trunk/tests/pango/test_fontdescription.py Sun Jun 15 04:53:56 2008
@@ -19,3 +19,21 @@
fd = pango.FontDescription('Sans 12px')
assert fd.get_family() == 'Sans'
assert fd.get_size() / pango.SCALE == 12
+
+def test_font_description_from_0_size_string():
+ fd = pango.FontDescription('Nimbus Sans L Regular 0')
+ assert fd.get_size() == 0
+ assert fd.get_family() == 'Nimbus Sans L Regular'
+
+ fd = pango.FontDescription('Sans')
+ assert fd.get_family() == 'Sans'
+ assert fd.get_size() == 0
+
+def test_negative_size_from_string():
+ '''
+ Ensure that a font string with a negative size gets it clamped to
+ 0.
+ '''
+ for x in -33, -159.99, -0.05, -12345678:
+ fd = pango.FontDescription('Sans %.2f' % x)
+ assert fd.get_size() == 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]