Hi Nicolas
On Tue, Jan 12, 2016 at 12:05 AM, Nicolas Goaziou
<[email protected]> wrote:
>
> Michael Brand <[email protected]> writes:
>
>> (ert-deftest test-org-capture/fill-template ()
>> - "Test `org-capture-fill-template' specifications."
>> + "Test `org-capture-fill-template' specifications.
>> +The tests here are very similar to those in
>> +`test-org-feed/fill-template'."
>
> Not sure the last sentence above is really interesting. Ditto for the
> other occurrences.
Maybe this and vice versa is better?:
(ert-deftest test-org-capture/fill-template ()
"Test `org-capture-fill-template' specifications."
;; When working on these tests consider to also change
;; `test-org-feed/fill-template'.
;; %(sexp) placeholder.
(should
[...]
>> - (string-match-p
>> - (format-time-string (substring (car org-time-stamp-formats) 1 -1))
>> + (equal
>> + (concat "[" (format-time-string
>> + (substring (car org-time-stamp-formats) 1 -1)) "]\n")
>> (org-capture-fill-template "%u")))
>> (should
>> - (string-match-p
>> - (format-time-string (substring (cdr org-time-stamp-formats) 1 -1))
>> + (equal
>> + (concat "[" (format-time-string
>> + (substring (cdr org-time-stamp-formats) 1 -1)) "]\n")
>
> I discovered recently (!) `org-time-stamp-formats' which avoids doing
> the substring dance. You may want to use it instead. Ditto for the other
> occurrences.
I don't understand because the org-time-stamp-formats you mention is
already used and does not cover inactive timestamps.
Michael