@@ -89,6 +89,15 @@ test_set_basic (void)
8989 hb_set_destroy (s );
9090}
9191
92+ static void
93+ print_set (hb_set_t * s )
94+ {
95+ printf ("{" );
96+ for (hb_codepoint_t next = HB_SET_VALUE_INVALID ; hb_set_next (s , & next ); )
97+ printf ("%d, " , next );
98+ printf ("}\n" );
99+ }
100+
92101static void
93102test_set_algebra (void )
94103{
@@ -149,7 +158,38 @@ test_set_algebra (void)
149158 g_assert (!hb_set_has (s , 13 ));
150159 g_assert (hb_set_has (s , 19 ));
151160
161+ /* https://github.com/behdad/harfbuzz/issues/579 */
162+ hb_set_clear (s );
163+ test_empty (s );
164+ hb_set_add_range (s , 886 , 895 );
165+ hb_set_add (s , 1024 );
166+ hb_set_add (s , 1152 );
167+ hb_set_clear (o );
168+ test_empty (o );
169+ hb_set_add (o , 889 );
170+ hb_set_add (o , 1024 );
171+ g_assert (!hb_set_is_equal (s , o ));
172+ hb_set_intersect (o , s );
173+ test_not_empty (o );
174+ g_assert (!hb_set_is_equal (s , o ));
175+ g_assert_cmpint (hb_set_get_population (o ), = = , 2 );
176+ g_assert (hb_set_has (o , 889 ));
177+ g_assert (hb_set_has (o , 1024 ));
178+ hb_set_clear (o );
179+ test_empty (o );
180+ hb_set_add_range (o , 887 , 889 );
181+ hb_set_add (o , 1121 );
182+ g_assert (!hb_set_is_equal (s , o ));
183+ hb_set_intersect (o , s );
184+ test_not_empty (o );
185+ g_assert (!hb_set_is_equal (s , o ));
186+ g_assert_cmpint (hb_set_get_population (o ), = = , 3 );
187+ g_assert (hb_set_has (o , 887 ));
188+ g_assert (hb_set_has (o , 888 ));
189+ g_assert (hb_set_has (o , 889 ));
190+
152191 hb_set_destroy (s );
192+ hb_set_destroy (o );
153193}
154194
155195static void
0 commit comments