aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorStig Brautaset <stig@brautaset.org>2016-02-26 22:26:15 +0000
committerStig Brautaset <stig@brautaset.org>2016-02-26 22:43:13 +0000
commit5cc183c13fcb70efe03bb8600f4295ed423e62b7 (patch)
tree273f55e620616c33339286ab2913c2f43abdc415 /test
parent6fac2785f0f3302eaa430cdc6115f5b8bdc05a59 (diff)
Support nested lists
Diffstat (limited to 'test')
-rw-r--r--test/ox-jira-test.el30
-rw-r--r--test/ox-jira-test.org36
2 files changed, 52 insertions, 14 deletions
diff --git a/test/ox-jira-test.el b/test/ox-jira-test.el
index 1ce4c1c..0fe6c5c 100644
--- a/test/ox-jira-test.el
+++ b/test/ox-jira-test.el
@@ -103,6 +103,24 @@ fum" 'jira))))
3. fa
3. fum" 'jira))))
+(ert-deftest ox-jira-test/nested-lists()
+ (should (equal "* fi
+** fo
+*** fa
+**** fum
+" (org-export-string-as "- fi
+ - fo
+ - fa
+ - fum" 'jira)))
+ (should (equal "* fi
+*# fo
+*#* fa
+*#*# fum
+" (org-export-string-as "- fi
+ 1. fo
+ - fa
+ 1. fum" 'jira))))
+
(ert-deftest ox-jira-test/unordered-list-with-checkboxes()
(should (equal "* (x) fi
* (/) fo
@@ -110,12 +128,12 @@ fum" 'jira))))
- [X] fo" 'jira))))
(ert-deftest ox-jira-test/checkboxes-and-statistics()
- (should (equal "h1. Progress \\[50%]
-* (x) fi
-* (/) fo
-" (org-export-string-as "* Progress [50%]
-- [ ] fi
-- [X] fo" 'jira))))
+ (should (equal "* (i) Progress \\[50%]
+** (x) fi
+** (/) fo
+" (org-export-string-as "- [-] Progress [50%]
+ - [ ] fi
+ - [X] fo" 'jira))))
(ert-deftest ox-jira-test/src-blocks ()
(should (equal "{code:none}
diff --git a/test/ox-jira-test.org b/test/ox-jira-test.org
index eb64ac4..8a698f5 100644
--- a/test/ox-jira-test.org
+++ b/test/ox-jira-test.org
@@ -197,6 +197,28 @@
3. fum" 'jira))))
#+END_SRC
+ Ok, we handle flat lists. How about nested ones?
+
+ #+BEGIN_SRC emacs-lisp
+ (ert-deftest ox-jira-test/nested-lists()
+ (should (equal "* fi
+ ,** fo
+ ,*** fa
+ ,**** fum
+ " (org-export-string-as "- fi
+ - fo
+ - fa
+ - fum" 'jira)))
+ (should (equal "* fi
+ ,*# fo
+ ,*#* fa
+ ,*#*# fum
+ " (org-export-string-as "- fi
+ 1. fo
+ - fa
+ 1. fum" 'jira))))
+ #+END_SRC
+
Right! That was simple enough. Let's add some checkboxes.
#+BEGIN_SRC emacs-lisp
@@ -211,16 +233,14 @@
#+BEGIN_SRC emacs-lisp
(ert-deftest ox-jira-test/checkboxes-and-statistics()
- (should (equal "h1. Progress \\[50%]
- ,* (x) fi
- ,* (/) fo
- " (org-export-string-as "* Progress [50%]
- - [ ] fi
- - [X] fo" 'jira))))
+ (should (equal "* (i) Progress \\[50%]
+ ,** (x) fi
+ ,** (/) fo
+ " (org-export-string-as "- [-] Progress [50%]
+ - [ ] fi
+ - [X] fo" 'jira))))
#+END_SRC
-
-
** Source code
I use Org mode for literate programming, and executable lab notes, so we