summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2019-03-16 09:33:50 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-03-16 09:33:50 +0100
commit02bde9634f772c1c12eda36f82a956333f587b94 (patch)
tree8eb8c78e211d7c1022e2b605852f89b1caf0bb00
parent1466e931312f7bac862e5d1352fb85cd9788130b (diff)
parentf0dc3a06d15bf0b5be57d5976bb18b831d3763b3 (diff)
downloadorg-mode-02bde9634f772c1c12eda36f82a956333f587b94.tar.gz
Merge branch 'master' of code.orgmode.org:bzg/org-mode
-rw-r--r--testing/lisp/test-org-clock.el174
1 files changed, 89 insertions, 85 deletions
diff --git a/testing/lisp/test-org-clock.el b/testing/lisp/test-org-clock.el
index 6690662..6432e17 100644
--- a/testing/lisp/test-org-clock.el
+++ b/testing/lisp/test-org-clock.el
@@ -576,125 +576,129 @@ CLOCK: [2016-12-28 Wed 13:09]--[2016-12-28 Wed 15:09] => 2:00"
"Test \":link\" parameter in Clock table."
;; If there is no file attached to the document, link directly to
;; the headline.
- (should
- (equal
- "| Headline | Time |
+ (let (org-link-descriptive)
+ (should
+ (equal
+ "| Headline | Time |
|--------------+---------|
| *Total time* | *26:00* |
|--------------+---------|
-| [[Foo][Foo]] | 26:00 |"
- (org-test-with-temp-text
- "* Foo
+| [[Foo][Foo]] | 26:00 |"
+ (org-test-with-temp-text
+ "* Foo
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (test-org-clock-clocktable-contents ":link t"))))
- ;; Otherwise, link to the headline in the current file.
- (should
- (equal
- "| Headline | Time |
-|-------------------------------------------+---------|
-| *Total time* | *26:00* |
-|-------------------------------------------+---------|
+ (test-org-clock-clocktable-contents ":link t"))))
+ ;; Otherwise, link to the headline in the current file.
+ (should
+ (equal
+ "| Headline | Time |
+|-----------------------------+---------|
+| *Total time* | *26:00* |
+|-----------------------------+---------|
| [[file:filename::Foo][Foo]] | 26:00 |"
- (org-test-with-temp-text-in-file
- "* Foo
+ (org-test-with-temp-text
+ (org-test-with-temp-text-in-file
+ "* Foo
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (let ((file (buffer-file-name)))
- (replace-regexp-in-string
- (regexp-quote file) "filename"
- (test-org-clock-clocktable-contents ":link t :lang en"))))))
- ;; Ignore TODO keyword, priority cookie, COMMENT and tags in
- ;; headline.
- (should
- (equal
- "| Headline | Time |
+ (let ((file (buffer-file-name)))
+ (replace-regexp-in-string
+ (regexp-quote file) "filename"
+ (test-org-clock-clocktable-contents ":link t :lang en"))))
+ (org-table-align)
+ (buffer-substring-no-properties (point-min) (point-max)))))
+ ;; Ignore TODO keyword, priority cookie, COMMENT and tags in
+ ;; headline.
+ (should
+ (equal
+ "| Headline | Time |
|--------------+---------|
| *Total time* | *26:00* |
|--------------+---------|
-| [[Foo][Foo]] | 26:00 |"
- (org-test-with-temp-text
- "* TODO Foo
+| [[Foo][Foo]] | 26:00 |"
+ (org-test-with-temp-text
+ "* TODO Foo
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (test-org-clock-clocktable-contents ":link t :lang en"))))
- (should
- (equal
- "| Headline | Time |
+ (test-org-clock-clocktable-contents ":link t :lang en"))))
+ (should
+ (equal
+ "| Headline | Time |
|--------------+---------|
| *Total time* | *26:00* |
|--------------+---------|
-| [[Foo][Foo]] | 26:00 |"
- (org-test-with-temp-text
- "* [#A] Foo
+| [[Foo][Foo]] | 26:00 |"
+ (org-test-with-temp-text
+ "* [#A] Foo
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (test-org-clock-clocktable-contents ":link t :lang en"))))
- (should
- (equal
- "| Headline | Time |
+ (test-org-clock-clocktable-contents ":link t :lang en"))))
+ (should
+ (equal
+ "| Headline | Time |
|--------------+---------|
| *Total time* | *26:00* |
|--------------+---------|
-| [[Foo][Foo]] | 26:00 |"
- (org-test-with-temp-text
- "* COMMENT Foo
+| [[Foo][Foo]] | 26:00 |"
+ (org-test-with-temp-text
+ "* COMMENT Foo
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (test-org-clock-clocktable-contents ":link t"))))
- (should
- (equal
- "| Headline | Time |
+ (test-org-clock-clocktable-contents ":link t"))))
+ (should
+ (equal
+ "| Headline | Time |
|--------------+---------|
| *Total time* | *26:00* |
|--------------+---------|
-| [[Foo][Foo]] | 26:00 |"
- (org-test-with-temp-text
- "* Foo :tag:
+| [[Foo][Foo]] | 26:00 |"
+ (org-test-with-temp-text
+ "* Foo :tag:
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (test-org-clock-clocktable-contents ":link t :lang en"))))
- ;; Remove statistics cookie from headline description.
- (should
- (equal
- "| Headline | Time |
+ (test-org-clock-clocktable-contents ":link t :lang en"))))
+ ;; Remove statistics cookie from headline description.
+ (should
+ (equal
+ "| Headline | Time |
|--------------+---------|
| *Total time* | *26:00* |
|--------------+---------|
-| [[Foo][Foo]] | 26:00 |"
- (org-test-with-temp-text
- "* Foo [50%]
+| [[Foo][Foo]] | 26:00 |"
+ (org-test-with-temp-text
+ "* Foo [50%]
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (test-org-clock-clocktable-contents ":link t :lang en"))))
- (should
- (equal
- "| Headline | Time |
+ (test-org-clock-clocktable-contents ":link t :lang en"))))
+ (should
+ (equal
+ "| Headline | Time |
|--------------+---------|
| *Total time* | *26:00* |
|--------------+---------|
-| [[Foo][Foo]] | 26:00 |"
- (org-test-with-temp-text
- "* Foo [1/2]
+| [[Foo][Foo]] | 26:00 |"
+ (org-test-with-temp-text
+ "* Foo [1/2]
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (test-org-clock-clocktable-contents ":link t :lang en"))))
- ;; Replace links with their description, or turn them into plain
- ;; links if there is no description.
- (should
- (equal
- "| Headline | Time |
-|-----------------------------------------+---------|
-| *Total time* | *26:00* |
-|-----------------------------------------+---------|
+ (test-org-clock-clocktable-contents ":link t :lang en"))))
+ ;; Replace links with their description, or turn them into plain
+ ;; links if there is no description.
+ (should
+ (equal
+ "| Headline | Time |
+|-----------------------------------------------------------+---------|
+| *Total time* | *26:00* |
+|-----------------------------------------------------------+---------|
| [[Foo [[https://orgmode.org\\][Org mode]\\]][Foo Org mode]] | 26:00 |"
- (org-test-with-temp-text
- "* Foo [[https://orgmode.org][Org mode]]
+ (org-test-with-temp-text
+ "* Foo [[https://orgmode.org][Org mode]]
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (test-org-clock-clocktable-contents ":link t :lang en"))))
- (should
- (equal
- "| Headline | Time |
-|------------------------------+---------|
-| *Total time* | *26:00* |
-|------------------------------+---------|
+ (test-org-clock-clocktable-contents ":link t :lang en"))))
+ (should
+ (equal
+ "| Headline | Time |
+|-----------------------------------------------------------+---------|
+| *Total time* | *26:00* |
+|-----------------------------------------------------------+---------|
| [[Foo [[https://orgmode.org]\\]][Foo https://orgmode.org]] | 26:00 |"
- (org-test-with-temp-text
- "* Foo [[https://orgmode.org]]
+ (org-test-with-temp-text
+ "* Foo [[https://orgmode.org]]
CLOCK: [2016-12-27 Wed 13:09]--[2016-12-28 Wed 15:09] => 26:00"
- (test-org-clock-clocktable-contents ":link t :lang en")))))
+ (test-org-clock-clocktable-contents ":link t :lang en"))))))
(ert-deftest test-org-clock/clocktable/compact ()
"Test \":compact\" parameter in Clock table."