Merge commit '49a41dc75931cc2d2f7e74b7801f8cc327039e8e'

This commit is contained in:
Behdad Esfahbod 2017-10-25 17:23:20 -06:00
commit bf133497e5
1 changed files with 40 additions and 0 deletions

View File

@ -89,6 +89,15 @@ test_set_basic (void)
hb_set_destroy (s);
}
static void
print_set (hb_set_t *s)
{
printf ("{");
for (hb_codepoint_t next = HB_SET_VALUE_INVALID; hb_set_next (s, &next); )
printf ("%d, ", next);
printf ("}\n");
}
static void
test_set_algebra (void)
{
@ -149,7 +158,38 @@ test_set_algebra (void)
g_assert (!hb_set_has (s, 13));
g_assert (hb_set_has (s, 19));
/* https://github.com/behdad/harfbuzz/issues/579 */
hb_set_clear (s);
test_empty (s);
hb_set_add_range (s, 886, 895);
hb_set_add (s, 1024);
hb_set_add (s, 1152);
hb_set_clear (o);
test_empty (o);
hb_set_add (o, 889);
hb_set_add (o, 1024);
g_assert (!hb_set_is_equal (s, o));
hb_set_intersect (o, s);
test_not_empty (o);
g_assert (!hb_set_is_equal (s, o));
g_assert_cmpint (hb_set_get_population (o), ==, 2);
g_assert (hb_set_has (o, 889));
g_assert (hb_set_has (o, 1024));
hb_set_clear (o);
test_empty (o);
hb_set_add_range (o, 887, 889);
hb_set_add (o, 1121);
g_assert (!hb_set_is_equal (s, o));
hb_set_intersect (o, s);
test_not_empty (o);
g_assert (!hb_set_is_equal (s, o));
g_assert_cmpint (hb_set_get_population (o), ==, 3);
g_assert (hb_set_has (o, 887));
g_assert (hb_set_has (o, 888));
g_assert (hb_set_has (o, 889));
hb_set_destroy (s);
hb_set_destroy (o);
}
static void