[PATCH v2 2/6] test: emacs: new test "notmuch-show: change tags of all messages in current buffer"
Pieter Praet writes: > * test/emacs: > > New subtest "notmuch-show: change tags of all messages in current buffer": > `notmuch-show-tag-all' ("*") changes tags of *all* messages in current > buffer. > --- > test/emacs | 15 +++ > 1 files changed, 15 insertions(+), 0 deletions(-) > > diff --git a/test/emacs b/test/emacs > index ec1dbb0..d2dbafc 100755 > --- a/test/emacs > +++ b/test/emacs > @@ -136,6 +136,21 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\") > output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) > test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, > Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox > unread)" > > +test_begin_subtest "notmuch-show: change tags of all messages in current > buffer" > +query="$os_x_darwin_thread" > +filter="from:Jiang" > +add_tag="notmuch-show-tag-all" > +del_tag="inbox" > +count_total=$(notmuch count -- "$query") # = 4 > +count_match=$(notmuch count -- "$query" AND "$filter") # = 2 In this test, what use is count_match? Just so that the tests' forms are the same? Maybe you want to put an assertion that count_total != count_match, just for sanity's sake? Otherwise, patches 1-3 look fine to me. Ethan
Re: [PATCH v2 2/6] test: emacs: new test "notmuch-show: change tags of all messages in current buffer"
Pieter Praet writes: > * test/emacs: > > New subtest "notmuch-show: change tags of all messages in current buffer": > `notmuch-show-tag-all' ("*") changes tags of *all* messages in current > buffer. > --- > test/emacs | 15 +++ > 1 files changed, 15 insertions(+), 0 deletions(-) > > diff --git a/test/emacs b/test/emacs > index ec1dbb0..d2dbafc 100755 > --- a/test/emacs > +++ b/test/emacs > @@ -136,6 +136,21 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\") > output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) > test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, > Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox > unread)" > > +test_begin_subtest "notmuch-show: change tags of all messages in current > buffer" > +query="$os_x_darwin_thread" > +filter="from:Jiang" > +add_tag="notmuch-show-tag-all" > +del_tag="inbox" > +count_total=$(notmuch count -- "$query") # = 4 > +count_match=$(notmuch count -- "$query" AND "$filter") # = 2 In this test, what use is count_match? Just so that the tests' forms are the same? Maybe you want to put an assertion that count_total != count_match, just for sanity's sake? Otherwise, patches 1-3 look fine to me. Ethan ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH v2 2/6] test: emacs: new test "notmuch-show: change tags of all messages in current buffer"
* test/emacs: New subtest "notmuch-show: change tags of all messages in current buffer": `notmuch-show-tag-all' ("*") changes tags of *all* messages in current buffer. --- test/emacs | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/test/emacs b/test/emacs index ec1dbb0..d2dbafc 100755 --- a/test/emacs +++ b/test/emacs @@ -136,6 +136,21 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\") output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" +test_begin_subtest "notmuch-show: change tags of all messages in current buffer" +query="$os_x_darwin_thread" +filter="from:Jiang" +add_tag="notmuch-show-tag-all" +del_tag="inbox" +count_total=$(notmuch count -- "$query") # = 4 +count_match=$(notmuch count -- "$query" AND "$filter") # = 2 +test_emacs "(notmuch-search \"$query AND $filter\") +(notmuch-test-wait) +(notmuch-search-show-thread) +(execute-kbd-macro \"*+$add_tag -$del_tag\")" +count_changed=$(notmuch count -- "$query" AND tag:"$add_tag" AND NOT tag:"$del_tag") +notmuch tag +"$del_tag" -"$add_tag" -- "$query" # revert tag changes +test_expect_equal "$count_changed" "$count_total" # assert that CHANGED == TOTAL + test_begin_subtest "Message with .. in Message-Id:" add_message [id]=123..456 at example '[subject]="Message with .. in Message-Id"' test_emacs '(notmuch-search "id:\"123..456 at example\"") -- 1.7.8.1
[PATCH v2 2/6] test: emacs: new test "notmuch-show: change tags of all messages in current buffer"
* test/emacs: New subtest "notmuch-show: change tags of all messages in current buffer": `notmuch-show-tag-all' ("*") changes tags of *all* messages in current buffer. --- test/emacs | 15 +++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/test/emacs b/test/emacs index ec1dbb0..d2dbafc 100755 --- a/test/emacs +++ b/test/emacs @@ -136,6 +136,21 @@ test_emacs "(notmuch-show \"$os_x_darwin_thread\") output=$(notmuch search $os_x_darwin_thread | notmuch_search_sanitize) test_expect_equal "$output" "thread:XXX 2009-11-18 [4/4] Jjgod Jiang, Alexander Botero-Lowry; [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)" +test_begin_subtest "notmuch-show: change tags of all messages in current buffer" +query="$os_x_darwin_thread" +filter="from:Jiang" +add_tag="notmuch-show-tag-all" +del_tag="inbox" +count_total=$(notmuch count -- "$query") # = 4 +count_match=$(notmuch count -- "$query" AND "$filter") # = 2 +test_emacs "(notmuch-search \"$query AND $filter\") +(notmuch-test-wait) +(notmuch-search-show-thread) +(execute-kbd-macro \"*+$add_tag -$del_tag\")" +count_changed=$(notmuch count -- "$query" AND tag:"$add_tag" AND NOT tag:"$del_tag") +notmuch tag +"$del_tag" -"$add_tag" -- "$query" # revert tag changes +test_expect_equal "$count_changed" "$count_total" # assert that CHANGED == TOTAL + test_begin_subtest "Message with .. in Message-Id:" add_message [id]=123..456@example '[subject]="Message with .. in Message-Id"' test_emacs '(notmuch-search "id:\"123..456@example\"") -- 1.7.8.1 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch