Merge branch 'master' into next

This commit is contained in:
Marco Wahl 2019-11-26 22:45:10 +01:00
commit 8ded89cc38
6 changed files with 340 additions and 216 deletions

View File

@ -13173,7 +13173,7 @@ general options (see [[*Export Settings]]).
#+vindex: org-latex-subtitle-format #+vindex: org-latex-subtitle-format
The document's subtitle. It is typeset as per The document's subtitle. It is typeset as per
~org-latex-subtitle-format~. If ~org-latex-subtitle-separate~ is ~org-latex-subtitle-format~. If ~org-latex-subtitle-separate~ is
non-~nil~, it is typed as part of the ~\title~ macro. See non-~nil~, it is typed outside of the ~\title~ macro. See
~org-latex-hyperref-template~ for customizing metadata items. See ~org-latex-hyperref-template~ for customizing metadata items. See
~org-latex-title-command~ for typesetting description into the ~org-latex-title-command~ for typesetting description into the
document's front matter. document's front matter.

View File

@ -59,6 +59,7 @@
(declare-function org-element-type "org-element" (element)) (declare-function org-element-type "org-element" (element))
(declare-function org-entry-get "org" (pom property &optional inherit literal-nil)) (declare-function org-entry-get "org" (pom property &optional inherit literal-nil))
(declare-function org-escape-code-in-region "org-src" (beg end)) (declare-function org-escape-code-in-region "org-src" (beg end))
(declare-function org-in-commented-heading-p "org" (&optional no-inheritance))
(declare-function org-indent-line "org" ()) (declare-function org-indent-line "org" ())
(declare-function org-list-get-list-end "org-list" (item struct prevs)) (declare-function org-list-get-list-end "org-list" (item struct prevs))
(declare-function org-list-prevs-alist "org-list" (struct)) (declare-function org-list-prevs-alist "org-list" (struct))
@ -2780,7 +2781,8 @@ block but are passed literally to the \"example-block\"."
(concat (funcall c-wrap (car cs)) "\n" (concat (funcall c-wrap (car cs)) "\n"
b "\n" b "\n"
(funcall c-wrap (cadr cs))))))))) (funcall c-wrap (cadr cs)))))))))
(if (re-search-forward name-regexp nil t) (if (and (re-search-forward name-regexp nil t)
(not (org-in-commented-heading-p)))
;; Found a source block named SOURCE-NAME. ;; Found a source block named SOURCE-NAME.
;; Assume it is unique; do not look after ;; Assume it is unique; do not look after
;; `:noweb-ref' header argument. ;; `:noweb-ref' header argument.
@ -2791,14 +2793,16 @@ block but are passed literally to the \"example-block\"."
;; those with a matching Noweb reference. ;; those with a matching Noweb reference.
(let ((expansion nil)) (let ((expansion nil))
(org-babel-map-src-blocks nil (org-babel-map-src-blocks nil
(let* ((info (org-babel-get-src-block-info 'light)) (unless (org-in-commented-heading-p)
(parameters (nth 2 info))) (let* ((info
(when (equal source-name (org-babel-get-src-block-info 'light))
(cdr (assq :noweb-ref parameters))) (parameters (nth 2 info)))
(push (funcall expand-body info) expansion) (when (equal source-name
(push (or (cdr (assq :noweb-sep parameters)) (cdr (assq :noweb-ref parameters)))
"\n") (push (funcall expand-body info) expansion)
expansion)))) (push (or (cdr (assq :noweb-sep parameters))
"\n")
expansion)))))
(when expansion (when expansion
(mapconcat #'identity (mapconcat #'identity
(nreverse (cdr expansion)) (nreverse (cdr expansion))

View File

@ -9162,6 +9162,7 @@ the same tree node, and the headline of the tree node in the Org file."
(hdmarker (org-get-at-bol 'org-hd-marker)) (hdmarker (org-get-at-bol 'org-hd-marker))
(todayp (org-agenda-today-p (org-get-at-bol 'day))) (todayp (org-agenda-today-p (org-get-at-bol 'day)))
(inhibit-read-only t) (inhibit-read-only t)
org-loop-over-headlines-in-active-region
org-agenda-headline-snapshot-before-repeat newhead just-one) org-agenda-headline-snapshot-before-repeat newhead just-one)
(org-with-remote-undo buffer (org-with-remote-undo buffer
(with-current-buffer buffer (with-current-buffer buffer

View File

@ -296,6 +296,90 @@ another block
(org-split-string (buffer-string)))) (org-split-string (buffer-string))))
(delete-file file)))))) (delete-file file))))))
(ert-deftest ob-tangle/commented-src-blocks ()
"Test omission of commented src blocks."
(should
(equal '("A")
(let ((file (make-temp-file "org-tangle-")))
(unwind-protect
(progn
(org-test-with-temp-text-in-file
(format "#+property: header-args :tangle %S
* A
#+begin_src emacs-lisp
A
#+end_src
* COMMENT B
#+begin_src emacs-lisp
B
#+end_src
* C
# #+begin_src emacs-lisp
# C
# #+end_src
* D
#+begin_comment
#+begin_src emacs-lisp
D
#+end_src
#+end_comment"
file)
(org-babel-tangle))
(with-temp-buffer
(insert-file-contents file)
(org-split-string (buffer-string))))
(delete-file file)))))
(should
(equal '("A")
(let ((file (make-temp-file "org-tangle-")))
(unwind-protect
(progn
(org-test-with-temp-text-in-file
(format "#+property: header-args :tangle %S
* A
#+begin_src elisp :noweb yes
A
<<B>>
<<C>>
<<D>>
#+end_src
* COMMENT B
#+begin_src elisp :noweb-ref B
B
#+end_src
* C
# #+begin_src elisp :noweb-ref C
# C
# #+end_src
* D
#+begin_comment
#+begin_src elisp :noweb-ref D
D
#+end_src
#+end_comment"
file)
(let (org-babel-noweb-error-all-langs
org-babel-noweb-error-langs)
(org-babel-tangle)))
(with-temp-buffer
(insert-file-contents file)
(org-split-string (buffer-string))))
(delete-file file))))))
(provide 'test-ob-tangle) (provide 'test-ob-tangle)
;;; test-ob-tangle.el ends here ;;; test-ob-tangle.el ends here

View File

@ -758,6 +758,30 @@ x
#+name: bar #+name: bar
#+begin_src emacs-lisp #+begin_src emacs-lisp
baz baz
#+end_src"
(org-babel-expand-noweb-references))))
;; Respect COMMENT headlines
(should
(equal "C"
(org-test-with-temp-text "
#+begin_src emacs-lisp :noweb yes<point>
<<foo>>
#+end_src
* COMMENT A
#+name: foo
#+begin_src emacs-lisp
A
#+end_src
* COMMENT B
#+begin_src emacs-lisp :noweb-ref foo
B
#+end_src
* C
#+begin_src emacs-lisp :noweb-ref foo
C
#+end_src" #+end_src"
(org-babel-expand-noweb-references))))) (org-babel-expand-noweb-references)))))

View File

@ -876,259 +876,270 @@ CLOCK: [2016-12-28 Wed 13:09]--[2016-12-28 Wed 13:09] => 0:00"
;; Regression test: week crossing month boundary before :wstart ;; Regression test: week crossing month boundary before :wstart
;; day-of-week. ;; day-of-week.
(should (should
(equal " (string-match-p
Weekly report starting on: [2017-09-25 Mon] "
| Headline | Time | .*?\\[2017-09-25 .*
|--------------+--------| .*
| *Total time* | *1:00* | .*
|--------------+--------| |.*?| \\*1:00\\* |
| Foo | 1:00 |" .*
(org-test-with-temp-text | Foo +| 1:00 +|"
"* Foo (org-test-with-temp-text
"* Foo
CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00 CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00
CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00 CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00
CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00" CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
":step week :block 2017-09 :stepskip0 t"))))) ":step week :block 2017-09 :stepskip0 t")))))
(should (should
(equal " (string-match-p
Weekly report starting on: [2017-10-01 Sun] "
| Headline | Time | .*?\\[2017-10-01 .*
|--------------+--------| .*
| *Total time* | *2:00* | .*
|--------------+--------| |.*?| \\*2:00\\* |
| Foo | 2:00 | .*
| Foo +| 2:00 |
Weekly report starting on: [2017-10-02 Mon] .*?\\[2017-10-02 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *7:00* | |.*?| \\*7:00\\* |
|--------------+--------| .*
| Foo | 7:00 | | Foo +| 7:00 +|
Weekly report starting on: [2017-10-09 Mon] .*?\\[2017-10-09 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *5:00* | |.*?| \\*5:00\\* |
|--------------+--------| .*
| Foo | 5:00 | | Foo +| 5:00 +|
" "
(org-test-with-temp-text (org-test-with-temp-text
"* Foo "* Foo
CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00 CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00
CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00 CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00
CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00 CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00
CLOCK: [2017-10-08 Sun 09:00]--[2017-10-08 Sun 13:00] => 4:00 CLOCK: [2017-10-08 Sun 09:00]--[2017-10-08 Sun 13:00] => 4:00
CLOCK: [2017-10-09 Mon 09:00]--[2017-10-09 Mon 14:00] => 5:00" CLOCK: [2017-10-09 Mon 09:00]--[2017-10-09 Mon 14:00] => 5:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
":step week :block 2017-10 :stepskip0 t"))))) ":step week :block 2017-10 :stepskip0 t")))))
;; :step day ;; :step day
(should (should
(equal " (string-match-p
Daily report: [2017-10-02 Mon] "
| Headline | Time | .*?\\[2017-10-02 .*
|--------------+--------| .*
| *Total time* | *3:00* | .*
|--------------+--------| |.*?| \\*3:00\\* |
| Foo | 3:00 | .*
| Foo +| 3:00 +|
Daily report: [2017-10-03 Tue] .*?\\[2017-10-03 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *0:00* | |.*?| \\*0:00\\* |
Daily report: [2017-10-04 Wed] .*?\\[2017-10-04 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *0:00* | |.*?| \\*0:00\\* |
Daily report: [2017-10-05 Thu] .*?\\[2017-10-05 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *0:00* | |.*?| \\*0:00\\* |
Daily report: [2017-10-06 Fri] .*?\\[2017-10-06 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *0:00* | |.*?| \\*0:00\\* |
Daily report: [2017-10-07 Sat] .*?\\[2017-10-07 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *0:00* | |.*?| \\*0:00\\* |
Daily report: [2017-10-08 Sun] .*?\\[2017-10-08 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *4:00* | |.*?| \\*4:00\\* |
|--------------+--------| .*
| Foo | 4:00 |" | Foo +| 4:00 +|"
(org-test-with-temp-text (org-test-with-temp-text
"* Foo "* Foo
CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00 CLOCK: [2017-09-30 Sat 12:00]--[2017-09-30 Sat 13:00] => 1:00
CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00 CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00
CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00 CLOCK: [2017-10-02 Mon 11:00]--[2017-10-02 Mon 14:00] => 3:00
CLOCK: [2017-10-08 Sun 09:00]--[2017-10-08 Sun 13:00] => 4:00 CLOCK: [2017-10-08 Sun 09:00]--[2017-10-08 Sun 13:00] => 4:00
CLOCK: [2017-10-09 Mon 09:00]--[2017-10-09 Mon 14:00] => 5:00" CLOCK: [2017-10-09 Mon 09:00]--[2017-10-09 Mon 14:00] => 5:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
":step day :block 2017-W40"))))) ":step day :block 2017-W40")))))
;; Regression test: take :tstart and :tend hours into consideration. ;; Regression test: take :tstart and :tend hours into consideration.
(should (should
(equal " (string-match-p
Weekly report starting on: [2017-12-25 Mon] "
| Headline | Time | .*?\\[2017-12-25 .*
|--------------+--------| .*
| *Total time* | *8:00* | .*
|--------------+--------| |.*?| \\*8:00\\* |
| Foo | 8:00 |" .*
(org-test-with-temp-text | Foo +| 8:00 +|"
"* Foo (org-test-with-temp-text
"* Foo
CLOCK: [2017-12-27 Wed 08:00]--[2017-12-27 Wed 16:00] => 8:00" CLOCK: [2017-12-27 Wed 08:00]--[2017-12-27 Wed 16:00] => 8:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
(concat ":step week :tstart \"<2017-12-25 Mon>\" " (concat ":step week :tstart \"<2017-12-25 Mon>\" "
":tend \"<2017-12-27 Wed 23:59>\"")))))) ":tend \"<2017-12-27 Wed 23:59>\""))))))
(should (should
(equal " (string-match-p
Daily report: [2017-12-27 Wed] "
| Headline | Time | .*?\\[2017-12-27 .*
|--------------+--------| .*
| *Total time* | *8:00* | .*
|--------------+--------| |.*?| \\*8:00\\* |
| Foo | 8:00 |" .*
(org-test-with-temp-text | Foo +| 8:00 +|"
"* Foo (org-test-with-temp-text
"* Foo
CLOCK: [2017-12-27 Wed 08:00]--[2017-12-27 Wed 16:00] => 8:00" CLOCK: [2017-12-27 Wed 08:00]--[2017-12-27 Wed 16:00] => 8:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
(concat ":step day :tstart \"<2017-12-25 Mon>\" " (concat ":step day :tstart \"<2017-12-25 Mon>\" "
":tend \"<2017-12-27 Wed 23:59>\" :stepskip0 t")))))) ":tend \"<2017-12-27 Wed 23:59>\" :stepskip0 t"))))))
;; Test :step week", without or with ":wstart" parameter. ;; Test :step week", without or with ":wstart" parameter.
(should (should
(equal " (string-match-p
Weekly report starting on: [2012-03-26 Mon] "
| Headline | Time | .*?\\[2012-03-26 .*
|--------------+--------| .*
| *Total time* | *8:00* | .*
|--------------+--------| |.*?| \\*8:00\\* |
| Foo | 8:00 | .*
| Foo +| 8:00 +|
Weekly report starting on: [2012-04-02 Mon] .*?\\[2012-04-02 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *8:00* | |.*?| \\*8:00\\* |
|--------------+--------| .*
| Foo | 8:00 | | Foo +| 8:00 +|
" "
(org-test-with-temp-text (org-test-with-temp-text
"* Foo "* Foo
CLOCK: [2012-03-29 Thu 08:00]--[2012-03-29 Thu 16:00] => 8:00 CLOCK: [2012-03-29 Thu 08:00]--[2012-03-29 Thu 16:00] => 8:00
CLOCK: [2012-04-03 Thu 08:00]--[2012-04-03 Thu 16:00] => 8:00" CLOCK: [2012-04-03 Thu 08:00]--[2012-04-03 Thu 16:00] => 8:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
":step week :block 2012 :stepskip0 t"))))) ":step week :block 2012 :stepskip0 t")))))
(should (should
(equal " (string-match-p
Weekly report starting on: [2012-03-29 Thu] "
| Headline | Time | .*?\\[2012-03-29 .*
|--------------+---------| .*
| *Total time* | *16:00* | .*
|--------------+---------| |.*?| \\*16:00\\* |
| Foo | 16:00 | .*
| Foo +| 16:00 +|
" "
(org-test-with-temp-text (org-test-with-temp-text
"* Foo "* Foo
CLOCK: [2012-03-29 Thu 08:00]--[2012-03-29 Thu 16:00] => 8:00 CLOCK: [2012-03-29 Thu 08:00]--[2012-03-29 Thu 16:00] => 8:00
CLOCK: [2012-04-03 Thu 08:00]--[2012-04-03 Thu 16:00] => 8:00" CLOCK: [2012-04-03 Thu 08:00]--[2012-04-03 Thu 16:00] => 8:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
":step week :wstart 4 :block 2012 :stepskip0 t"))))) ":step week :wstart 4 :block 2012 :stepskip0 t")))))
;; Test ":step month" without and with ":mstart". ;; Test ":step month" without and with ":mstart".
(should (should
(equal " (string-match-p
Monthly report starting on: [2014-03-01 Sat] "
| Headline | Time | .*?\\[2014-03-01 .*
|--------------+--------| .*
| *Total time* | *8:00* | .*
|--------------+--------| |.*?| \\*8:00\\* |
| Foo | 8:00 | .*
| Foo +| 8:00 +|
Monthly report starting on: [2014-04-01 Tue] .*?\\[2014-04-01 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *8:00* | |.*?| \\*8:00\\* |
|--------------+--------| .*
| Foo | 8:00 | | Foo +| 8:00 +|
" "
(org-test-with-temp-text (org-test-with-temp-text
"* Foo "* Foo
CLOCK: [2014-03-04 Tue 08:00]--[2014-03-04 Tue 16:00] => 8:00 CLOCK: [2014-03-04 Tue 08:00]--[2014-03-04 Tue 16:00] => 8:00
CLOCK: [2014-04-03 Thu 08:00]--[2014-04-03 Thu 16:00] => 8:00" CLOCK: [2014-04-03 Thu 08:00]--[2014-04-03 Thu 16:00] => 8:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
":step month :block 2014 :stepskip0 t"))))) ":step month :block 2014 :stepskip0 t")))))
(should (should
(equal " (string-match-p
Monthly report starting on: [2014-03-04 Tue] "
| Headline | Time | .*?\\[2014-03-04 .*
|--------------+---------| .*
| *Total time* | *16:00* | .*
|--------------+---------| |.*?| \\*16:00\\* |
| Foo | 16:00 | .*
| Foo +| 16:00 +|
" "
(org-test-with-temp-text (org-test-with-temp-text
"* Foo "* Foo
CLOCK: [2014-03-04 Tue 08:00]--[2014-03-04 Tue 16:00] => 8:00 CLOCK: [2014-03-04 Tue 08:00]--[2014-03-04 Tue 16:00] => 8:00
CLOCK: [2014-04-03 Thu 08:00]--[2014-04-03 Thu 16:00] => 8:00" CLOCK: [2014-04-03 Thu 08:00]--[2014-04-03 Thu 16:00] => 8:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
":step month :mstart 4 :block 2014 :stepskip0 t"))))) ":step month :mstart 4 :block 2014 :stepskip0 t")))))
;; Test ":step year". ;; Test ":step year".
(should (should
(equal " (string-match-p
Annual report starting on: [2012-01-01 Sun] "
| Headline | Time | .*?\\[2012-01-01 .*
|--------------+--------| .*
| *Total time* | *8:00* | .*
|--------------+--------| |.*?| \\*8:00\\* |
| Foo | 8:00 | .*
| Foo +| 8:00 +|
Annual report starting on: [2014-01-01 Wed] .*?\\[2014-01-01 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *8:00* | |.*?| \\*8:00\\* |
|--------------+--------| .*
| Foo | 8:00 | | Foo +| 8:00 +|
" "
(org-test-with-temp-text (org-test-with-temp-text
"* Foo "* Foo
CLOCK: [2012-03-29 Thu 08:00]--[2012-03-29 Thu 16:00] => 8:00 CLOCK: [2012-03-29 Thu 08:00]--[2012-03-29 Thu 16:00] => 8:00
CLOCK: [2014-03-04 Tue 08:00]--[2014-03-04 Tue 16:00] => 8:00" CLOCK: [2014-03-04 Tue 08:00]--[2014-03-04 Tue 16:00] => 8:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
":step year :block untilnow :stepskip0 t"))))) ":step year :block untilnow :stepskip0 t")))))
;; Regression test: Respect DST ;; Regression test: Respect DST
(should (should
(equal " (string-match-p
Daily report: [2018-10-29 Mon] "
| Headline | Time | .*?\\[2018-10-29 .*
|--------------+--------| .*
| *Total time* | *8:00* | .*
|--------------+--------| |.*?| \\*8:00\\* |
| Foo | 8:00 | .*
| Foo +| 8:00 +|
" "
(org-test-with-temp-text (org-test-with-temp-text
"* Foo "* Foo
CLOCK: [2018-10-29 Mon 08:00]--[2018-10-29 Mon 16:00] => 8:00" CLOCK: [2018-10-29 Mon 08:00]--[2018-10-29 Mon 16:00] => 8:00"
(let ((system-time-locale "en_US")) (let ((system-time-locale "en_US"))
(test-org-clock-clocktable-contents (test-org-clock-clocktable-contents
(concat ":step day " (concat ":step day "
":stepskip0 t " ":stepskip0 t "
":tstart \"2018-10-01\" " ":tstart \"2018-10-01\" "
":tend \"2018-11-01\""))))))) ":tend \"2018-11-01\"")))))))
(ert-deftest test-org-clock/clocktable/extend-today-until () (ert-deftest test-org-clock/clocktable/extend-today-until ()
"Test assignment of clock time to days in presence of \"org-extend-today-until\"." "Test assignment of clock time to days in presence of \"org-extend-today-until\"."
@ -1154,20 +1165,20 @@ CLOCK: [2017-10-01 Sun 11:00]--[2017-10-01 Sun 13:00] => 2:00"
;; Week-length block - time on Monday before 04:00 should be ;; Week-length block - time on Monday before 04:00 should be
;; assigned to previous week. ;; assigned to previous week.
(should (should
(equal " (string-match-p "
Weekly report starting on: [2017-10-01 Sun] .*? \\[2017-10-01 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *2:00* | |.*?| \\*2:00\\* |
|--------------+--------| .*
| Foo | 2:00 | | Foo +| 2:00 |
Weekly report starting on: [2017-10-02 Mon] .*? \\[2017-10-02 .*
| Headline | Time | .*
|--------------+--------| .*
| *Total time* | *2:00* | |.*?| \\*2:00\\* |
|--------------+--------| .*
| Foo | 2:00 | | Foo +| 2:00 |
" "
(org-test-with-temp-text (org-test-with-temp-text
"* Foo "* Foo