Add test for emplace generation for variant

This commit is contained in:
Patrick Pelissier committed 2022-04-28 23:10:40 +02:00
1 parent dc487c7e64
commit aba2f90c9d
1 file changed
+9
+9
View File
@@ -219,9 +219,18 @@ test_triple(void)
assert( triple_type(t) == triple_z_value);
assert( testobj_cmp (z, *triple_get_z(t)) == 0);
triple_emplace_s(t, "HELLO");
assert( triple_type(t) == triple_s_value);
assert( string_equal_str_p (*triple_get_s(t), "HELLO"));
testobj_clear(z);
string_clear(s);
triple_clear(t);
triple_init_emplace_s(t, "INIT HELLO2");
assert( triple_type(t) == triple_s_value);
assert( string_equal_str_p (*triple_get_s(t), "INIT HELLO2"));
triple_clear(t);
}
VARIANT_DEF2(single,