]> git.cworth.org Git - notmuch/commitdiff
test: use subtest name for generated message subject by default
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Sat, 10 Mar 2012 01:24:51 +0000 (05:24 +0400)
committerDavid Bremner <bremner@debian.org>
Sun, 18 Mar 2012 12:14:22 +0000 (09:14 -0300)
Before the change, messages generated by generate_message() used "Test
message #N" for default subject where N is the generated messages
counter.  Since message subject is commonly present in expected
results, there is a chance of breaking other tests when a new
generate_message() call is added.  The patch changes default subject
value for generated messages to subtest name if it is available.  If
subtest name is not available (i.e. message is generated during test
initialization), the old default value is used (in this case it is
fine to have the counter in the subject).

Another benefit of this change is a sane default value for subject in
generated messages, which would allow to simplify code like:

  test_begin_subtest "test for a cool feature"
  add_message [subject]="message for test for a cool feature"


No differences found