[geary: 4/4] Merge branch 'mjog/unit-test-subproject' into 'mainline'



commit cfbac77fa48fd80249476a1d882c7dc9650fd95e
Merge: 3550c6972 7c4858955
Author: Michael Gratton <mike vee net>
Date:   Tue Jun 30 08:08:54 2020 +0000

    Merge branch 'mjog/unit-test-subproject' into 'mainline'
    
    Unit test subproject and cleanup
    
    See merge request GNOME/geary!517

 meson.build                                        |   9 +
 subprojects/vala-unit/COPYING                      | 464 ++++++++++++++++++
 subprojects/vala-unit/README.md                    |   6 +
 subprojects/vala-unit/meson.build                  | 152 ++++++
 subprojects/vala-unit/meson_options.txt            |  12 +
 subprojects/vala-unit/src/async-result-waiter.vala | 108 +++++
 .../vala-unit/src/collection-assertions.vala       | 499 +++++++++++++++++++
 subprojects/vala-unit/src/expected-call.vala       | 148 ++++++
 subprojects/vala-unit/src/mock-object.vala         | 318 ++++++++++++
 subprojects/vala-unit/src/test-adaptor.vala        |  75 +++
 subprojects/vala-unit/src/test-assertions.vala     | 533 +++++++++++++++++++++
 subprojects/vala-unit/src/test-case.vala           | 207 ++++++++
 .../vala-unit/test/collection-assertions.vala      | 219 +++++++++
 subprojects/vala-unit/test/test-assertions.vala    | 299 ++++++++++++
 subprojects/vala-unit/test/test-driver.vala        |  26 +
 test/client/accounts/accounts-manager-test.vala    |   4 +-
 .../application/application-client-test.vala       |  12 +-
 .../components/client-web-view-test-case.vala      |   2 +-
 test/client/composer/composer-web-view-test.vala   |   4 +-
 test/client/util/util-avatar-test.vala             |  38 +-
 test/client/util/util-cache-test.vala              |  24 +-
 test/client/util/util-email-test.vala              |  20 +-
 test/client/util/util-js-test.vala                 |   2 +-
 .../engine/api/geary-account-information-test.vala |  18 +-
 test/engine/api/geary-account-mock.vala            |   8 +-
 test/engine/api/geary-attachment-test.vala         |  20 +-
 test/engine/api/geary-contact-store-mock.vala      |   7 +-
 .../api/geary-credentials-mediator-mock.vala       |   9 +-
 test/engine/api/geary-engine-test.vala             |  12 +-
 test/engine/api/geary-folder-mock.vala             |   8 +-
 test/engine/api/geary-folder-path-test.vala        | 211 ++++----
 .../engine/api/geary-service-information-test.vala |  14 +-
 test/engine/app/app-conversation-monitor-test.vala |  63 +--
 test/engine/app/app-conversation-set-test.vala     |   8 +-
 test/engine/app/app-conversation-test.vala         |  85 +---
 .../common/common-contact-harvester-mock.vala      |   4 +-
 .../common/common-contact-harvester-test.vala      |  28 +-
 .../common/common-contact-store-impl-test.vala     |  54 +--
 test/engine/db/db-versioned-database-test.vala     |   2 +-
 test/engine/imap-db/imap-db-account-test.vala      |  24 +-
 test/engine/imap-db/imap-db-attachment-test.vala   |  95 ++--
 test/engine/imap-db/imap-db-database-test.vala     |   5 +-
 test/engine/imap-db/imap-db-folder-test.vala       |  36 +-
 .../imap/command/imap-create-command-test.vala     |  12 +-
 .../imap/command/imap-fetch-command-test.vala      |  30 +-
 .../imap/message/imap-mailbox-specifier-test.vala  |  57 +--
 .../imap/parameter/imap-list-parameter-test.vala   |   4 +-
 .../imap/transport/imap-client-session-test.vala   |  31 +-
 .../imap/transport/imap-deserializer-test.vala     |  23 +-
 test/engine/mime/mime-content-type-test.vala       |  16 +-
 .../engine/rfc822/rfc822-mailbox-address-test.vala |  60 +--
 .../rfc822/rfc822-mailbox-addresses-test.vala      |  19 +-
 test/engine/rfc822/rfc822-message-data-test.vala   |  64 +--
 test/engine/rfc822/rfc822-message-test.vala        |  32 +-
 test/engine/rfc822/rfc822-part-test.vala           |  23 +-
 test/engine/util-ascii-test.vala                   |  32 +-
 test/engine/util-config-file-test.vala             |  26 +-
 test/engine/util-html-test.vala                    |  68 +--
 test/engine/util-idle-manager-test.vala            |   3 +-
 test/engine/util-timeout-manager-test.vala         |   8 +-
 test/js/client-page-state-test.vala                |   2 +-
 test/js/composer-page-state-test.vala              |   2 +-
 test/js/conversation-page-state-test.vala          |  31 +-
 test/meson.build                                   |  33 +-
 test/mock-object.vala                              | 442 -----------------
 test/test-case.vala                                | 464 +-----------------
 test/test-client.vala                              |  26 +-
 test/test-engine.vala                              |  92 ++--
 test/test-integration.vala                         |   8 +-
 69 files changed, 3834 insertions(+), 1666 deletions(-)
---
diff --cc test/engine/imap/transport/imap-deserializer-test.vala
index b3a617126,49edced3d..156207cd4
--- a/test/engine/imap/transport/imap-deserializer-test.vala
+++ b/test/engine/imap/transport/imap-deserializer-test.vala
@@@ -117,45 -107,11 +117,45 @@@ class Geary.Imap.DeserializerTest : Tes
          this.process.begin(Expect.MESSAGE, this.async_completion);
          RootParameters? message = this.process.end(async_result());
  
-         assert_int(2, message.size);
+         assert_equal<int?>(message.size, 2);
          assert_true(message.get(1) is ListParameter, "Not parsed as list");
-         assert_string(bytes, message.get(1).to_string());
+         assert_equal(message.get(1).to_string(), bytes);
      }
  
 +    public void parse_flag() throws GLib.Error {
 +        string bytes = "\\iamaflag";
 +        this.stream.add_data(UNTAGGED.data);
 +        this.stream.add_data(bytes.data);
 +        this.stream.add_data(EOL.data);
 +
 +        this.process.begin(Expect.MESSAGE, this.async_completion);
 +        RootParameters? message = this.process.end(async_result());
 +
 +        assert_int(2, message.size);
 +        assert_true(
 +            message.get(1) is UnquotedStringParameter,
 +            "Not parsed as n atom"
 +        );
 +        assert_string(bytes, message.get(1).to_string());
 +    }
 +
 +    public void parse_wildcard_flag() throws GLib.Error {
 +        string bytes = "\\*";
 +        this.stream.add_data(UNTAGGED.data);
 +        this.stream.add_data(bytes.data);
 +        this.stream.add_data(EOL.data);
 +
 +        this.process.begin(Expect.MESSAGE, this.async_completion);
 +        RootParameters? message = this.process.end(async_result());
 +
 +        assert_int(2, message.size);
 +        assert_true(
 +            message.get(1) is UnquotedStringParameter,
 +            "Not parsed as n atom"
 +        );
 +        assert_string(bytes, message.get(1).to_string());
 +    }
 +
      public void parse_response_code() throws Error {
          string bytes = "[OK]";
          this.stream.add_data(UNTAGGED.data);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]