mirror of
https://github.com/journeyman-cc/smeagol.git
synced 2026-04-12 18:05:06 +00:00
implement indention
This commit is contained in:
parent
12d4661db9
commit
535465c362
4 changed files with 99 additions and 6 deletions
|
|
@ -96,7 +96,7 @@ more text"
|
|||
some text
|
||||
* List
|
||||
|
||||
## Heading 3
|
||||
#### Heading 3
|
||||
more text
|
||||
some text
|
||||
Simple content.
|
||||
|
|
|
|||
35
test/smeagol/test/include/indent.clj
Normal file
35
test/smeagol/test/include/indent.clj
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
(ns smeagol.test.include.indent
|
||||
(:require [clojure.test :refer :all]
|
||||
[smeagol.include.indent :as sut]))
|
||||
|
||||
(deftest test-parse-heading
|
||||
(testing
|
||||
(is (= '(["# " "# " "" "# "])
|
||||
(sut/parse-heading "# h1")))
|
||||
(is (= '(["\n# " "\n# " "\n" "# "])
|
||||
(sut/parse-heading "\n# h1")))))
|
||||
|
||||
(deftest test-indent-heading
|
||||
(testing
|
||||
(is (= "# h1"
|
||||
(sut/do-indent-heading 0 "# h1")))
|
||||
(is (= "### h1"
|
||||
(sut/do-indent-heading 2 "# h1")))
|
||||
(is (= "\n### h1"
|
||||
(sut/do-indent-heading 2 "\n# h1")))))
|
||||
|
||||
(deftest test-parse-list
|
||||
(testing
|
||||
(is (= '([" * " " * " " " "* "])
|
||||
(sut/parse-list " * list")))
|
||||
(is (= '(["\n * " "\n * " "\n " "* "])
|
||||
(sut/parse-list "\n * list")))))
|
||||
|
||||
(deftest test-indent-list
|
||||
(testing
|
||||
(is (= " * list"
|
||||
(sut/do-indent-list 0 " * list")))
|
||||
(is (= " * list"
|
||||
(sut/do-indent-list 2 " * list")))
|
||||
(is (= "\n * list"
|
||||
(sut/do-indent-list 2 "\n * list")))))
|
||||
Loading…
Add table
Add a link
Reference in a new issue