[test-set] Test length of iterator

This commit is contained in:
Behdad Esfahbod 2022-11-18 18:17:34 -07:00
parent 2892fc71e8
commit 356708e34a
1 changed files with 2 additions and 0 deletions

View File

@ -34,6 +34,7 @@ main (int argc, char **argv)
hb_set_t v1 {1, 2};
hb_set_t v2 {v1};
assert (v1.get_population () == 2);
assert (hb_len (hb_iter (v1)) == 2);
assert (v2.get_population () == 2);
}
@ -51,6 +52,7 @@ main (int argc, char **argv)
hb_set_t s {1, 2};
hb_set_t v (std::move (s));
assert (s.get_population () == 0);
assert (hb_len (hb_iter (s)) == 0);
assert (v.get_population () == 2);
}