Make Geary.EmailIdentifier serialisation a bit less ad-hoc

Require EmailIdentifier implementations to use an outer GVariant of the
form `(yr)` (that is, a byte and an arbitrary length tuple), so that
inner representations are independent of the outer format.
This commit is contained in:
Michael Gratton 2019-12-10 13:15:32 +11:00 committed by Michael James Gratton
parent c93cfc38b1
commit 981ea845f4
4 changed files with 28 additions and 14 deletions

View file

@ -86,10 +86,18 @@ public class Geary.ImapEngine.GenericAccountTest : TestCase {
);
assert_non_null(
test_article.to_email_identifier(new GLib.Variant("(yxx)", 'i', 1, 2))
test_article.to_email_identifier(
new GLib.Variant(
"(yr)", 'i', new GLib.Variant("(xx)", 1, 2)
)
)
);
assert_non_null(
test_article.to_email_identifier(new GLib.Variant("(yxx)", 'o', 1, 2))
test_article.to_email_identifier(
new GLib.Variant(
"(yr)", 'o', new GLib.Variant("(xx)", 1, 2)
)
)
);
}