summaryrefslogtreecommitdiff
path: root/scripts/common_tests.py
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-09-29 17:46:32 -0700
committerJames Godfrey-Kittle <jamesgk@google.com>2015-09-29 17:46:32 -0700
commit26990b6f5a8170656a0064e49b2c9b7a4f9b8d54 (patch)
tree26ba545000df0387940c3c4a9c5b7b43c33e9602 /scripts/common_tests.py
parentbdf6327ad72f162ca16a16c446d2093ffb75f143 (diff)
Generalize coverage tests in common_tests
Diffstat (limited to 'scripts/common_tests.py')
-rw-r--r--scripts/common_tests.py33
1 files changed, 8 insertions, 25 deletions
diff --git a/scripts/common_tests.py b/scripts/common_tests.py
index f30afa0..a744482 100644
--- a/scripts/common_tests.py
+++ b/scripts/common_tests.py
@@ -295,39 +295,22 @@ class TestCharacterCoverage(FontTest):
def setUp(self):
_, self.fonts = self.loaded_fonts
- self.LEGACY_PUA = frozenset({0xEE01, 0xEE02, 0xF6C3})
- def test_inclusion_of_legacy_pua(self):
- """Tests that legacy PUA characters remain in the fonts."""
- for font in self.fonts:
- charset = coverage.character_set(font)
- for char in self.LEGACY_PUA:
- self.assertIn(char, charset)
+ def test_inclusion(self):
+ """Tests for characters which should be included."""
- def test_non_inclusion_of_other_pua(self):
- """Tests that there are not other PUA characters except legacy ones."""
for font in self.fonts:
charset = coverage.character_set(font)
- pua_chars = {
- char for char in charset
- if 0xE000 <= char <= 0xF8FF or 0xF0000 <= char <= 0x10FFFF}
- self.assertTrue(pua_chars <= self.LEGACY_PUA)
+ for char in self.include:
+ self.assertIn(char, charset)
- def test_lack_of_unassigned_chars(self):
- """Tests that unassigned characters are not in the fonts."""
- for font in self.fonts:
- charset = coverage.character_set(font)
- self.assertNotIn(0x2072, charset)
- self.assertNotIn(0x2073, charset)
- self.assertNotIn(0x208F, charset)
+ def test_exclusion(self):
+ """Tests that characters which should be excluded are absent."""
- def test_inclusion_of_sound_recording_copyright(self):
- """Tests that sound recording copyright symbol is in the fonts."""
for font in self.fonts:
charset = coverage.character_set(font)
- self.assertIn(
- 0x2117, charset, # SOUND RECORDING COPYRIGHT
- 'U+2117 not found in %s.' % font_data.font_name(font))
+ for char in self.exclude:
+ self.assertNotIn(char, charset)
class TestLigatures(FontTest):