[set] add a test demonstrating a bug in hb_set_union.

This commit is contained in:
Garret Rieger 2018-03-06 13:46:51 -08:00 committed by Behdad Esfahbod
parent 9b4a5d7ef1
commit 9a6f9b4d42
1 changed files with 10 additions and 0 deletions

View File

@ -137,10 +137,13 @@ test_set_algebra (void)
{
hb_set_t *s = hb_set_create ();
hb_set_t *o = hb_set_create ();
hb_set_t *o2 = hb_set_create ();
hb_set_add (o, 13);
hb_set_add (o, 19);
hb_set_add (o2, 0x660E);
test_empty (s);
g_assert (!hb_set_is_equal (s, o));
hb_set_set (s, o);
@ -157,6 +160,13 @@ test_set_algebra (void)
g_assert (hb_set_has (s, 10));
g_assert (hb_set_has (s, 13));
hb_set_clear (s);
test_empty (s);
g_assert_cmpint (hb_set_get_population (s), ==, 0);
hb_set_union (s, o2);
g_assert_cmpint (hb_set_get_population (s), ==, 1);
g_assert (hb_set_has (s, 0x660E));
hb_set_clear (s);
test_empty (s);
hb_set_add_range (s, 10, 17);