geary/test/engine/imap/parameter/imap-list-parameter-test.vala
Michael James Gratton 51b44f0f4b Remove ListParameter.parent property so lists can have multiple parents.
The ListParameter.parent property only existed to make the deserialier's
life easier, but is also why sketchy code was needed for appending search
criteria from a ServerSearchEmail replay op to the actual IMAP search
command sent to the server.

This removes the property altogether, and replaces its only use in
Deserialier with a stack, as nature intended. This means lists can be
added to more than one other list, and e.g. when a search is executed,
the search critera can be used for multiple requests.
2018-09-01 22:09:18 +10:00

30 lines
874 B
Vala

/*
* Copyright 2018 Michael Gratton <mike@vee.net>
*
* This software is licensed under the GNU Lesser General Public License
* (version 2.1 or later). See the COPYING file in this distribution.
*/
class Geary.Imap.ListParameterTest : TestCase {
public ListParameterTest() {
base("Geary.Imap.ListParameterTest");
add_test("add_to_multiple_parents", add_to_multiple_parents);
}
// See GitLab Issue #26
public void add_to_multiple_parents() throws GLib.Error {
ListParameter child = new ListParameter();
ListParameter parent_1 = new ListParameter();
ListParameter parent_2 = new ListParameter();
parent_1.add(child);
parent_2.add(child);
assert_int(1, parent_1.size, "Parent 1 does not contain child");
assert_int(1, parent_2.size, "Parent 2 does not contain child");
}
}